meta: fix/add checks for GL_EXT_framebuffer_sRGB
authorBrian Paul <brianp@vmware.com>
Sat, 17 Sep 2011 17:13:31 +0000 (11:13 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 17 Sep 2011 17:14:21 +0000 (11:14 -0600)
This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension
is not supported.

Note: This is a candidate for the 7.11 branch

src/mesa/drivers/common/meta.c

index 482bd98a254cd21e39d4e3220c2d5d4d257f1e8c..1b71aa19445060404cde665491efe1d03e986ccd 100644 (file)
@@ -1222,7 +1222,9 @@ blitframebuffer_texture(struct gl_context *ctx,
            _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
                                GL_SKIP_DECODE_EXT);
         }
-        _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+         if (ctx->Extensions.EXT_framebuffer_sRGB) {
+            _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+         }
 
          _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
          _mesa_set_enable(ctx, target, GL_TRUE);
@@ -1288,7 +1290,7 @@ blitframebuffer_texture(struct gl_context *ctx,
         if (ctx->Extensions.EXT_texture_sRGB_decode) {
            _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
         }
-        if (ctx->Extensions.EXT_texture_sRGB_decode && fbo_srgb_save) {
+        if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) {
            _mesa_Enable(GL_FRAMEBUFFER_SRGB_EXT);
         }