From bf65c9ea411b2fd394b82a0d5502675d427d9fd0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 6 May 2011 18:32:06 +0200 Subject: [PATCH] mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter Reviewed-by: Brian Paul --- src/mesa/main/samplerobj.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index 6e53f641e95..229267f8c94 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -568,6 +568,25 @@ set_sampler_max_anisotropy(struct gl_context *ctx, } +static GLuint +set_sampler_cube_map_seamless(struct gl_context *ctx, + struct gl_sampler_object *samp, GLboolean param) +{ + if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) + return INVALID_PNAME; + + if (samp->CubeMapSeamless == param) + return GL_FALSE; + + if (param != GL_TRUE && param != GL_FALSE) + return INVALID_VALUE; + + flush(ctx); + samp->CubeMapSeamless = param; + return GL_TRUE; +} + + static void GLAPIENTRY _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) { @@ -616,6 +635,9 @@ _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, param); + break; case GL_TEXTURE_BORDER_COLOR: /* fall-through */ default: @@ -697,6 +719,9 @@ _mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, param); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param); + break; case GL_TEXTURE_BORDER_COLOR: /* fall-through */ default: @@ -775,6 +800,9 @@ _mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: { GLfloat c[4]; @@ -863,6 +891,9 @@ _mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colorf(ctx, sampObj, params); break; @@ -942,6 +973,9 @@ _mesa_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colori(ctx, sampObj, params); break; @@ -1022,6 +1056,9 @@ _mesa_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colorui(ctx, sampObj, params); break; -- 2.30.2