summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-08-01 12:38:56 -0700
committerEric Anholt <[email protected]>2012-08-08 16:21:30 -0700
commit4bbd12036819ed6a2d0993c437e0c02bf0c92b0b (patch)
tree64441e23a5b54a2dbadfbc0d8efc7ef880e38e45 /src/mesa/main/attrib.c
parent9f7b3d171306ed2ae588e1a4145c5a364cf986ff (diff)
mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an optional push/pop around framebuffer srgb setting. It didn't matter in the end, but the fix is sitting in my tree now. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r--src/mesa/main/attrib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 8bc7c348fab..9cab35b0c37 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -135,6 +135,9 @@ struct gl_enable_attrib
/* GL_ARB_point_sprite / GL_NV_point_sprite */
GLboolean PointSprite;
GLboolean FragmentShaderATI;
+
+ /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
+ GLboolean sRGBEnabled;
};
@@ -322,6 +325,9 @@ _mesa_PushAttrib(GLbitfield mask)
attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
save_attrib_data(&head, GL_ENABLE_BIT, attr);
+
+ /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
+ attr->sRGBEnabled = ctx->Color.sRGBEnabled;
}
if (mask & GL_EVAL_BIT) {
@@ -617,6 +623,10 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
enable->VertexProgramTwoSide,
GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
+ /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
+ TEST_AND_UPDATE(ctx->Color.sRGBEnabled, enable->sRGBEnabled,
+ GL_FRAMEBUFFER_SRGB);
+
/* texture unit enables */
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
const GLbitfield enabled = enable->Texture[i];
@@ -981,6 +991,9 @@ _mesa_PopAttrib(void)
_mesa_set_enable(ctx, GL_DITHER, color->DitherFlag);
_mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, color->ClampFragmentColor);
_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);
}
break;
case GL_CURRENT_BIT: