mesa/main: correct extension-checks for GL_FRAMEBUFFER_SRGB
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Feb 2019 12:18:05 +0000 (13:18 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 29 May 2019 08:54:09 +0000 (10:54 +0200)
This enum shouldn't be allowed on OpenGL ES 1.x, so let's instead
use the extenion-helpers, and check for desktop and gles extensions
separately.

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 1b0f7417affe29dead7b770c375b5ded3729bcfa..bbe66304eb95d205abad5416c60a6057addb2451 100644 (file)
@@ -1119,7 +1119,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
 
       /* GL3.0 - GL_framebuffer_sRGB */
       case GL_FRAMEBUFFER_SRGB_EXT:
-         CHECK_EXTENSION(EXT_framebuffer_sRGB);
+         if (!_mesa_has_EXT_framebuffer_sRGB(ctx) &&
+             !_mesa_has_EXT_sRGB_write_control(ctx))
+            goto invalid_enum_error;
          _mesa_set_framebuffer_srgb(ctx, state);
          return;
 
@@ -1743,7 +1745,9 @@ _mesa_IsEnabled( GLenum cap )
 
       /* GL3.0 - GL_framebuffer_sRGB */
       case GL_FRAMEBUFFER_SRGB_EXT:
-         CHECK_EXTENSION(EXT_framebuffer_sRGB);
+         if (!_mesa_has_EXT_framebuffer_sRGB(ctx) &&
+             !_mesa_has_EXT_sRGB_write_control(ctx))
+            goto invalid_enum_error;
          return ctx->Color.sRGBEnabled;
 
       /* GL_OES_EGL_image_external */