diff options
author | Ian Romanick <[email protected]> | 2012-07-25 16:03:44 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-23 10:15:30 -0700 |
commit | a0595cb4506251509e032a2592d6bb684480de4b (patch) | |
tree | 6f248f0bbc1c7d91affa49eb74986bf51b1f90d6 /src/mesa/main/texparam.c | |
parent | 842efb9447bd4c8c29599f1baeee8a380d5276c2 (diff) |
mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper
Ditto for glGetTexParameter targets.
v2: Add proper core-profile and GLES3 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 | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a0f736cd913..bb16228ee2c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -131,35 +131,42 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) switch (target) { case GL_TEXTURE_1D: - return texUnit->CurrentTex[TEXTURE_1D_INDEX]; + if (_mesa_is_desktop_gl(ctx)) + return texUnit->CurrentTex[TEXTURE_1D_INDEX]; + break; case GL_TEXTURE_2D: return texUnit->CurrentTex[TEXTURE_2D_INDEX]; case GL_TEXTURE_3D: - return texUnit->CurrentTex[TEXTURE_3D_INDEX]; + if (ctx->API != API_OPENGLES) + return texUnit->CurrentTex[TEXTURE_3D_INDEX]; + break; case GL_TEXTURE_CUBE_MAP: if (ctx->Extensions.ARB_texture_cube_map) { return texUnit->CurrentTex[TEXTURE_CUBE_INDEX]; } break; case GL_TEXTURE_RECTANGLE_NV: - if (ctx->Extensions.NV_texture_rectangle) { + if (_mesa_is_desktop_gl(ctx) + && ctx->Extensions.NV_texture_rectangle) { return texUnit->CurrentTex[TEXTURE_RECT_INDEX]; } break; case GL_TEXTURE_1D_ARRAY_EXT: - if (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array) { + if (_mesa_is_desktop_gl(ctx) + && (ctx->Extensions.MESA_texture_array || + ctx->Extensions.EXT_texture_array)) { return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX]; } break; case GL_TEXTURE_2D_ARRAY_EXT: - if (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array) { + if ((_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) + && (ctx->Extensions.MESA_texture_array || + ctx->Extensions.EXT_texture_array)) { return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX]; } break; case GL_TEXTURE_EXTERNAL_OES: - if (ctx->Extensions.OES_EGL_image_external) { + if (_mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external) { return texUnit->CurrentTex[TEXTURE_EXTERNAL_INDEX]; } break; |