summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-16 06:41:57 -0700
committerCorbin Simpson <[email protected]>2009-03-16 06:49:22 -0700
commit567aead92ae1b51578b0dea4709662b0d9c130e2 (patch)
treea303aa8772d3e310cb2e5735442ac4376e6f995a /src
parent3cce08e31326fb28ebc435065eba784d516922fd (diff)
r300-gallium: r500-fs: Clamp only when saturation flags are set.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
index e7e5a119d09..0a4f7c8d7e9 100644
--- a/src/gallium/drivers/r300/r300_state_shader.c
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -228,9 +228,7 @@ static INLINE void r500_emit_alu(struct r500_fragment_shader* fs,
R500_ALU_WMASK(dst->DstRegister.WriteMask);
}
- fs->instructions[i].inst0 |=
- R500_INST_TEX_SEM_WAIT |
- R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP;
+ fs->instructions[i].inst0 |= R500_INST_TEX_SEM_WAIT;
fs->instructions[i].inst4 =
R500_ALPHA_ADDRD(r300_fs_dst(assembler, &dst->DstRegister));
@@ -421,6 +419,12 @@ static void r500_fs_instruction(struct r500_fragment_shader* fs,
inst->Instruction.Opcode);
break;
}
+
+ /* Clamp, if saturation flags are set. */
+ if (inst->Instruction.Saturate == TGSI_SAT_ZERO_ONE) {
+ fs->instructions[fs->instruction_count - 1].inst0 |=
+ R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP;
+ }
}
static void r500_fs_finalize(struct r500_fragment_shader* fs,