summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-02-25 13:18:05 +0100
committerErik Faye-Lund <[email protected]>2019-05-29 10:54:09 +0200
commitc0dabc619211b83f5eb77aea03d0c1a3759f975d (patch)
tree3bd7b9850e5e0fadaa3c136c9b8bdd61bada5fd9
parenta33ff7876fa5e9c7b564791734bf47534225df13 (diff)
mesa/main: correct extension-checks for GL_FRAMEBUFFER_SRGB
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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/mesa/main/enable.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 1b0f7417aff..bbe66304eb9 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -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 */