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/programopt.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/programopt.c')
-rw-r--r-- | mesalib/src/mesa/program/programopt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesalib/src/mesa/program/programopt.c b/mesalib/src/mesa/program/programopt.c index 6601f7416..de311fd16 100644 --- a/mesalib/src/mesa/program/programopt.c +++ b/mesalib/src/mesa/program/programopt.c @@ -238,7 +238,7 @@ _mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog) * to vertex programs too.
*/
void
-_mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog)
+_mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog, GLboolean saturate)
{
static const gl_state_index fogPStateOpt[STATE_LENGTH]
= { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 };
@@ -290,7 +290,7 @@ _mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog) /* change the instruction to write to colorTemp w/ clamping */
inst->DstReg.File = PROGRAM_TEMPORARY;
inst->DstReg.Index = colorTemp;
- inst->SaturateMode = SATURATE_ZERO_ONE;
+ inst->SaturateMode = saturate;
/* don't break (may be several writes to result.color) */
}
inst++;
@@ -300,6 +300,7 @@ _mesa_append_fog_code(struct gl_context *ctx, struct gl_fragment_program *fprog) _mesa_init_instructions(inst, 5);
/* emit instructions to compute fog blending factor */
+ /* this is always clamped to [0, 1] regardless of fragment clamping */
if (fprog->FogOption == GL_LINEAR) {
/* MAD fogFactorTemp.x, fragment.fogcoord.x, fogPRefOpt.x, fogPRefOpt.y; */
inst->Opcode = OPCODE_MAD;
|