diff options
author | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
commit | 4e1588b6805ee5c7cd34e733cd1eff098d063b95 (patch) | |
tree | 763d6761b0131ecd36be7b0d48d2e644b8a25c95 /mesalib/src/mesa/program/prog_statevars.c | |
parent | a69f20daead874a20fad57a4fadd99df393f28d6 (diff) | |
parent | aee5cfef9a419ee2845d66b0c31e476880bea663 (diff) | |
download | vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.gz vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.bz2 vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/program/prog_statevars.c')
-rw-r--r-- | mesalib/src/mesa/program/prog_statevars.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/mesalib/src/mesa/program/prog_statevars.c b/mesalib/src/mesa/program/prog_statevars.c index df3c76d18..11176208c 100644 --- a/mesalib/src/mesa/program/prog_statevars.c +++ b/mesalib/src/mesa/program/prog_statevars.c @@ -237,11 +237,17 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], {
/* state[1] is the texture unit */
const GLuint unit = (GLuint) state[1];
- COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
+ else
+ COPY_4V(value, ctx->Texture.Unit[unit].EnvColorUnclamped);
}
return;
case STATE_FOG_COLOR:
- COPY_4V(value, ctx->Fog.Color);
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4V(value, ctx->Fog.Color);
+ else
+ COPY_4V(value, ctx->Fog.ColorUnclamped);
return;
case STATE_FOG_PARAMS:
value[0] = ctx->Fog.Density;
@@ -399,6 +405,22 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], }
return;
+ case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
+ {
+ const GLuint idx = (GLuint) state[2];
+ if(ctx->Light._ClampVertexColor &&
+ (idx == VERT_ATTRIB_COLOR0 ||
+ idx == VERT_ATTRIB_COLOR1)) {
+ value[0] = CLAMP(ctx->Current.Attrib[idx][0], 0.0f, 1.0f);
+ value[1] = CLAMP(ctx->Current.Attrib[idx][1], 0.0f, 1.0f);
+ value[2] = CLAMP(ctx->Current.Attrib[idx][2], 0.0f, 1.0f);
+ value[3] = CLAMP(ctx->Current.Attrib[idx][3], 0.0f, 1.0f);
+ }
+ else
+ COPY_4V(value, ctx->Current.Attrib[idx]);
+ }
+ return;
+
case STATE_NORMAL_SCALE:
ASSIGN_4V(value,
ctx->_ModelViewInvScale,
@@ -649,10 +671,12 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) return _NEW_LIGHT;
case STATE_TEXGEN:
- case STATE_TEXENV_COLOR:
return _NEW_TEXTURE;
+ case STATE_TEXENV_COLOR:
+ return _NEW_TEXTURE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
case STATE_FOG_COLOR:
+ return _NEW_FOG | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
case STATE_FOG_PARAMS:
return _NEW_FOG;
@@ -688,6 +712,8 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) switch (state[1]) {
case STATE_CURRENT_ATTRIB:
return _NEW_CURRENT_ATTRIB;
+ case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
+ return _NEW_CURRENT_ATTRIB | _NEW_LIGHT | _NEW_BUFFERS;
case STATE_NORMAL_SCALE:
return _NEW_MODELVIEW;
|