diff options
author | Marek Olšák <[email protected]> | 2011-05-06 18:32:06 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-05-06 20:06:30 +0200 |
commit | bf65c9ea411b2fd394b82a0d5502675d427d9fd0 (patch) | |
tree | 8be3bc1ccbbe7c54b7cc6065e9a1a02c9310db1e | |
parent | a19c42ffc606b594558a0c4f981662442ad6bb83 (diff) |
mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/main/samplerobj.c | 37 |
1 files changed, 37 insertions, 0 deletions
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; |