summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Haehnle <[email protected]>2008-07-27 15:14:07 +0200
committerNicolai Haehnle <[email protected]>2008-07-27 15:14:07 +0200
commit1bdf5e09a049d8d60bf147f9d88bbdb2b8588752 (patch)
tree0da93a8f33f96fd33a3d9124122f9dae62b5c967
parent85e44fcd51b2f2e0bb0c97161fdde1971767eefd (diff)
r500: Redirect TEX writes to output registers
While R500 fragment program texture instructions appear to support writemasks, they cannot write to the output FIFO immediately, so we need to insert a MOV for these instructions. This fixes piglit's fp-fragment-position and fp-incomplete-tex tests.
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c
index 7b18efa69d6..c78deab2ace 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.c
@@ -74,6 +74,13 @@ static GLboolean transform_TEX(
inst.DstReg.File = PROGRAM_TEMPORARY;
inst.DstReg.Index = radeonFindFreeTemporary(t);
inst.DstReg.WriteMask = WRITEMASK_XYZW;
+ } else if (inst.Opcode != OPCODE_KIL && inst.DstReg.File != PROGRAM_TEMPORARY) {
+ int tempreg = radeonFindFreeTemporary(t);
+
+ inst.DstReg.File = PROGRAM_TEMPORARY;
+ inst.DstReg.Index = tempreg;
+ inst.DstReg.WriteMask = WRITEMASK_XYZW;
+ destredirect = GL_TRUE;
}
tgt = radeonAppendInstructions(t->Program, 1);