summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2010-05-14 02:15:49 +0200
committerMarek Olšák <maraeo@gmail.com>2010-05-16 20:20:55 +0200
commit9d3c57281e4fe3842b41578c65bab5a6e23d76c8 (patch)
treeb57cdd65ddaaf9d3aaac60771a4dfc9075bf4493 /src/mesa/drivers/dri/r300/compiler
parent997f2eac5eeed75af0e6d02466d96e7d531822c6 (diff)
r300/compiler: fix peephole optimizer
Tested-by: Marek Olšák <maraeo@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_optimize.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
index 80e3eeacfc..fd608ccb72 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c
@@ -82,6 +82,18 @@ static void peephole_scan_read(void * data, struct rc_instruction * inst,
if (file != RC_FILE_TEMPORARY || index != s->Mov->U.I.DstReg.Index)
return;
+ /* These instructions cannot read from the constants file.
+ * see radeonTransformTEX()
+ */
+ if(s->Mov->U.I.SrcReg[0].File != RC_FILE_TEMPORARY &&
+ s->Mov->U.I.SrcReg[0].File != RC_FILE_INPUT &&
+ (inst->U.I.Opcode == RC_OPCODE_TEX ||
+ inst->U.I.Opcode == RC_OPCODE_TXB ||
+ inst->U.I.Opcode == RC_OPCODE_TXP ||
+ inst->U.I.Opcode == RC_OPCODE_KIL)){
+ s->Conflict = 1;
+ return;
+ }
if ((mask & s->MovMask) == mask) {
if (s->SourceClobbered) {
s->Conflict = 1;
@@ -109,7 +121,8 @@ static void peephole_scan_write(void * data, struct rc_instruction * inst,
s->DefinedMask |= mask;
else
s->DefinedMask &= ~mask;
- } else if (file == s->Mov->U.I.SrcReg[0].File && index == s->Mov->U.I.SrcReg[0].Index) {
+ }
+ if (file == s->Mov->U.I.SrcReg[0].File && index == s->Mov->U.I.SrcReg[0].Index) {
if (mask & s->SourcedMask)
s->SourceClobbered = 1;
} else if (s->Mov->U.I.SrcReg[0].RelAddr && file == RC_FILE_ADDRESS) {