summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-03-12 06:07:24 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-12 21:50:42 +0100
commit90292b8001ad55995aef6581fe27637fb8983973 (patch)
tree38a148d462c8962b0c20c5aa2544565f0a5e0ba7
parent6ea13078fb57c33243ffd24ee064d7425dd2faef (diff)
downloadmesa-90292b8001ad55995aef6581fe27637fb8983973.tar.gz
r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float. (cherry picked from commit e4707604ab46252d2e010906124775d3300f0be1)
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
index 6c3ce6c6f08..37f6defd858 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_tex.c
@@ -401,17 +401,21 @@ int radeonTransformTEX(
}
}
- /* Cannot write texture to output registers (all chips) or with masks (non-r500) */
+ /* Cannot write texture to output registers or with saturate (all chips),
+ * or with masks (non-r500). */
if (inst->U.I.Opcode != RC_OPCODE_KIL &&
(inst->U.I.DstReg.File != RC_FILE_TEMPORARY ||
+ inst->U.I.SaturateMode ||
(!c->is_r500 && inst->U.I.DstReg.WriteMask != RC_MASK_XYZW))) {
struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst);
inst_mov->U.I.Opcode = RC_OPCODE_MOV;
+ inst_mov->U.I.SaturateMode = inst->U.I.SaturateMode;
inst_mov->U.I.DstReg = inst->U.I.DstReg;
inst_mov->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
inst_mov->U.I.SrcReg[0].Index = rc_find_free_temporary(c);
+ inst->U.I.SaturateMode = 0;
inst->U.I.DstReg.File = RC_FILE_TEMPORARY;
inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index;
inst->U.I.DstReg.WriteMask = RC_MASK_XYZW;