diff options
author | Ian Romanick <[email protected]> | 2011-10-03 13:03:47 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-23 10:15:29 -0700 |
commit | 842efb9447bd4c8c29599f1baeee8a380d5276c2 (patch) | |
tree | a9681669339935ac5722294ed1b13aea39ef7afb /src/mesa/main/texparam.c | |
parent | d53101a9f31e1cba553c80dbafd23c748dd58a1d (diff) |
mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r-- | src/mesa/main/texparam.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a0c508caa3a..a0f736cd913 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -56,11 +56,16 @@ static GLboolean validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) { const struct gl_extensions * const e = & ctx->Extensions; + const bool is_desktop_gl = _mesa_is_desktop_gl(ctx); bool supported; switch (wrap) { case GL_CLAMP: - supported = (target != GL_TEXTURE_EXTERNAL_OES); + /* GL_CLAMP was removed in the core profile, and it has never existed in + * OpenGL ES. + */ + supported = (ctx->API == API_OPENGL) + && (target != GL_TEXTURE_EXTERNAL_OES); break; case GL_CLAMP_TO_EDGE: @@ -68,7 +73,7 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) break; case GL_CLAMP_TO_BORDER: - supported = e->ARB_texture_border_clamp + supported = is_desktop_gl && e->ARB_texture_border_clamp && (target != GL_TEXTURE_EXTERNAL_OES); break; @@ -80,13 +85,14 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) case GL_MIRROR_CLAMP_EXT: case GL_MIRROR_CLAMP_TO_EDGE_EXT: - supported = (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp) + supported = is_desktop_gl + && (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp) && (target != GL_TEXTURE_RECTANGLE_NV) && (target != GL_TEXTURE_EXTERNAL_OES); break; case GL_MIRROR_CLAMP_TO_BORDER_EXT: - supported = e->EXT_texture_mirror_clamp + supported = is_desktop_gl && e->EXT_texture_mirror_clamp && (target != GL_TEXTURE_RECTANGLE_NV) && (target != GL_TEXTURE_EXTERNAL_OES); break; |