aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-02-25 12:06:23 +0100
committerErik Faye-Lund <[email protected]>2019-05-23 11:35:55 +0200
commit147751a856432157726d0462406f89b0f87aa8d9 (patch)
treee6ee6619a43e8daf9f81ddbf89c14724596bb39f /src/mesa/main/enable.c
parent182d75d2a508cfd60b3b9082ce07369d3d28c32c (diff)
mesa/main: make the TEXTURE_CUBE_MAP checks consistent
IsEnabled(TEXTURE_CUBE_MAP) isn't supposed to be allowed, but our check allowed this anyway. Let's make these checks consistent, and while we're at it, modernize them a bit. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 83e7f9734d1..09f33afbc57 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -819,9 +819,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP:
- if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
+ if (!_mesa_has_ARB_texture_cube_map(ctx) &&
+ !_mesa_has_OES_texture_cube_map(ctx))
goto invalid_enum_error;
- CHECK_EXTENSION(ARB_texture_cube_map);
if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
return;
}
@@ -1595,7 +1595,9 @@ _mesa_IsEnabled( GLenum cap )
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP:
- CHECK_EXTENSION(ARB_texture_cube_map);
+ if (!_mesa_has_ARB_texture_cube_map(ctx) &&
+ !_mesa_has_OES_texture_cube_map(ctx))
+ goto invalid_enum_error;
return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
/* GL_EXT_secondary_color */