aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/state.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-30 07:22:44 +0000
committermarha <marha@users.sourceforge.net>2011-03-30 07:22:44 +0000
commit4e1588b6805ee5c7cd34e733cd1eff098d063b95 (patch)
tree763d6761b0131ecd36be7b0d48d2e644b8a25c95 /mesalib/src/mesa/main/state.c
parenta69f20daead874a20fad57a4fadd99df393f28d6 (diff)
parentaee5cfef9a419ee2845d66b0c31e476880bea663 (diff)
downloadvcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.gz
vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.bz2
vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/state.c')
-rw-r--r--mesalib/src/mesa/main/state.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c
index 70f8154e8..ee335340a 100644
--- a/mesalib/src/mesa/main/state.c
+++ b/mesalib/src/mesa/main/state.c
@@ -445,6 +445,35 @@ update_color(struct gl_context *ctx)
ctx->Color._LogicOpEnabled = _mesa_rgba_logicop_enabled(ctx);
}
+static void
+update_clamp_fragment_color(struct gl_context *ctx)
+{
+ if(ctx->Color.ClampFragmentColor == GL_FIXED_ONLY_ARB)
+ ctx->Color._ClampFragmentColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
+ else
+ ctx->Color._ClampFragmentColor = ctx->Color.ClampFragmentColor;
+}
+
+static void
+update_clamp_vertex_color(struct gl_context *ctx)
+{
+ if(ctx->Light.ClampVertexColor == GL_FIXED_ONLY_ARB)
+ ctx->Light._ClampVertexColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
+ else
+ ctx->Light._ClampVertexColor = ctx->Light.ClampVertexColor;
+}
+
+static void
+update_clamp_read_color(struct gl_context *ctx)
+{
+ if(ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB)
+ ctx->Color._ClampReadColor = !ctx->ReadBuffer || !ctx->ReadBuffer->Visual.floatMode;
+ else
+ ctx->Color._ClampReadColor = ctx->Color.ClampReadColor;
+}
+
+
+
/*
* Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
@@ -565,7 +594,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (ctx->FragmentProgram._MaintainTexEnvProgram) {
prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG |
_NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE |
- _NEW_PROGRAM);
+ _NEW_PROGRAM | _NEW_FRAG_CLAMP);
}
if (ctx->VertexProgram._MaintainTnlProgram) {
prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX |
@@ -599,6 +628,9 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & _NEW_LIGHT)
_mesa_update_lighting( ctx );
+ if (new_state & (_NEW_LIGHT | _NEW_BUFFERS))
+ update_clamp_vertex_color(ctx);
+
if (new_state & (_NEW_STENCIL | _NEW_BUFFERS))
_mesa_update_stencil( ctx );
@@ -617,6 +649,12 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & _NEW_COLOR)
update_color( ctx );
+ if (new_state & (_NEW_COLOR | _NEW_BUFFERS))
+ update_clamp_read_color(ctx);
+
+ if(new_state & (_NEW_FRAG_CLAMP | _NEW_BUFFERS))
+ update_clamp_fragment_color(ctx);
+
#if 0
if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
| _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))