mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
authorBrian Paul <brianp@vmware.com>
Tue, 28 Aug 2012 03:52:07 +0000 (21:52 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 29 Aug 2012 14:20:57 +0000 (08:20 -0600)
To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.

src/mesa/main/attrib.c

index 1a04eebdd1963a952183073257331ec967052e43..8cb2a689b60eeb77ab1e5abbba8bfe62178b5718 100644 (file)
@@ -989,7 +989,8 @@ _mesa_PopAttrib(void)
                _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
 
                /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
-               _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color->sRGBEnabled);
+               if (ctx->Extensions.EXT_framebuffer_sRGB)
+                  _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color->sRGBEnabled);
             }
             break;
          case GL_CURRENT_BIT: