mesa/main: make the TEXTURE_CUBE_MAP checks consistent
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Feb 2019 11:06:23 +0000 (12:06 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 23 May 2019 09:35:55 +0000 (11:35 +0200)
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 <erik.faye-lund@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/enable.c

index 83e7f9734d12a0a73359b9ab0274ff671a91ec6b..09f33afbc5711ef23eb2bd7dad8542609a21618a 100644 (file)
@@ -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 */