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 <erik.faye-lund@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Erik Faye-Lund
2019-02-25 13:18:05 +01:00
parent a33ff7876f
commit c0dabc6192
+6 -2
View 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 */