From: Erik Faye-Lund Date: Mon, 25 Feb 2019 12:18:05 +0000 (+0100) Subject: mesa/main: correct extension-checks for GL_FRAMEBUFFER_SRGB X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0dabc619211b83f5eb77aea03d0c1a3759f975d;p=mesa.git 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 Reviewed-by: Ian Romanick --- 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 */