[Mesa-dev] [PATCH 3/3] mesa: Save/restore GL_COLOR_SUM with the GL_ENABLE_BIT attrib group.

Kenneth Graunke kenneth at whitecape.org
Tue Feb 5 23:09:02 PST 2013


According to the GL 2.1 specification, Table 6.11 (Coloring),
GL_COLOR_SUM is supposed to be in the fog/enable attributes.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/main/attrib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 57d3667..a4c8fab 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -78,6 +78,7 @@ struct gl_enable_attrib
    GLboolean DepthTest;
    GLboolean Dither;
    GLboolean Fog;
+   GLboolean ColorSum;
    GLboolean Light[MAX_LIGHTS];
    GLboolean Lighting;
    GLboolean LineSmooth;
@@ -265,6 +266,7 @@ _mesa_PushAttrib(GLbitfield mask)
       attr->DepthTest = ctx->Depth.Test;
       attr->Dither = ctx->Color.DitherFlag;
       attr->Fog = ctx->Fog.Enabled;
+      attr->ColorSum = ctx->Fog.ColorSumEnabled;
       for (i = 0; i < ctx->Const.MaxLights; i++) {
          attr->Light[i] = ctx->Light.Light[i].Enabled;
       }
@@ -516,6 +518,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
    TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
    TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
    TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
+   TEST_AND_UPDATE(ctx->Fog.ColorSumEnabled, enable->ColorSum, GL_COLOR_SUM);
    TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
    TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
    TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple,
-- 
1.8.1.2



More information about the mesa-dev mailing list