summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_fragprog.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-23 16:31:31 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-23 16:32:00 +1100
commit3158035154915ae11bebca045e3f0ce3b0e264ee (patch)
treef85000cb48a9befd222e3ae26223e2c1c6b1eabe /src/gallium/drivers/nv40/nv40_fragprog.c
parentba223e91df8f372a983e99c453947e4340d7d884 (diff)
nv40: catch fp extra-const cases where both const and immd have same idx
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_fragprog.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_fragprog.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv40/nv40_fragprog.c b/src/gallium/drivers/nv40/nv40_fragprog.c
index 4cdbf962ab..c854ae89f7 100644
--- a/src/gallium/drivers/nv40/nv40_fragprog.c
+++ b/src/gallium/drivers/nv40/nv40_fragprog.c
@@ -384,7 +384,7 @@ nv40_fragprog_parse_instruction(struct nv40_fpc *fpc,
const struct nv40_sreg none = nv40_sr(NV40SR_NONE, 0);
struct nv40_sreg src[3], dst, tmp;
int mask, sat, unit;
- int ai = -1, ci = -1;
+ int ai = -1, ci = -1, ii = -1;
int i;
if (finst->Instruction.Opcode == TGSI_OPCODE_END)
@@ -428,8 +428,8 @@ nv40_fragprog_parse_instruction(struct nv40_fpc *fpc,
}
break;
case TGSI_FILE_CONSTANT:
- case TGSI_FILE_IMMEDIATE:
- if (ci == -1 || ci == fsrc->SrcRegister.Index) {
+ if ((ci == -1 && ii == -1) ||
+ ci == fsrc->SrcRegister.Index) {
ci = fsrc->SrcRegister.Index;
src[i] = tgsi_src(fpc, fsrc);
} else {
@@ -438,6 +438,17 @@ nv40_fragprog_parse_instruction(struct nv40_fpc *fpc,
tgsi_src(fpc, fsrc), none, none);
}
break;
+ case TGSI_FILE_IMMEDIATE:
+ if ((ci == -1 && ii == -1) ||
+ ii == fsrc->SrcRegister.Index) {
+ ii = fsrc->SrcRegister.Index;
+ src[i] = tgsi_src(fpc, fsrc);
+ } else {
+ src[i] = temp(fpc);
+ arith(fpc, 0, MOV, src[i], MASK_ALL,
+ tgsi_src(fpc, fsrc), none, none);
+ }
+ break;
case TGSI_FILE_TEMPORARY:
/* handled above */
break;