diff options
author | Ian Romanick <[email protected]> | 2012-07-27 06:45:54 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-23 10:15:31 -0700 |
commit | c11096e94a68ce0a1d7c9cda0f178ceca44ce25d (patch) | |
tree | 6c77fb34def442ebd30dfa34638e2831978e2bba /src/mesa/main/teximage.c | |
parent | 9848e86af0c937a6f7609289ab2705c3535f378f (diff) |
mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add GLES3 filtering. I'm not 100% sure this is correct.
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/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 3cd9d401553..5cf91183a20 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2127,6 +2127,24 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } + /* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the + * internalFormat. + */ + if (_mesa_is_gles(ctx) && !_mesa_is_gles3(ctx)) { + switch (internalFormat) { + case GL_ALPHA: + case GL_RGB: + case GL_RGBA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + break; + default: + _mesa_error(ctx, GL_INVALID_VALUE, + "glCopyTexImage%dD(internalFormat)", dimensions); + return GL_TRUE; + } + } + baseFormat = _mesa_base_tex_format(ctx, internalFormat); if (baseFormat < 0) { _mesa_error(ctx, GL_INVALID_VALUE, |