summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-30 19:00:07 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-03-30 19:57:18 +1000
commit3017999d9bee8f9d2ef170c1bb6926aab8e08393 (patch)
tree2b82b2f383b2da640cb794e1314a47fb3890b369 /src/gallium/drivers/nv40
parentce64778ed1f436d81178862dc0032dfd16b4b7de (diff)
nv40: vp const/immd fix
Diffstat (limited to 'src/gallium/drivers/nv40')
-rw-r--r--src/gallium/drivers/nv40/nv40_vertprog.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c
index e5ce894375..41885b9d4a 100644
--- a/src/gallium/drivers/nv40/nv40_vertprog.c
+++ b/src/gallium/drivers/nv40/nv40_vertprog.c
@@ -328,7 +328,7 @@ nv40_vertprog_parse_instruction(struct nv40_vpc *vpc,
struct nv40_sreg src[3], dst, tmp;
struct nv40_sreg none = nv40_sr(NV40SR_NONE, 0);
int mask;
- int ai = -1, ci = -1;
+ int ai = -1, ci = -1, ii = -1;
int i;
if (finst->Instruction.Opcode == TGSI_OPCODE_END)
@@ -358,12 +358,9 @@ nv40_vertprog_parse_instruction(struct nv40_vpc *vpc,
tgsi_src(vpc, fsrc), none, none);
}
break;
- /*XXX: index comparison is broken now that consts come from
- * two different register files.
- */
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(vpc, fsrc);
} else {
@@ -372,6 +369,17 @@ nv40_vertprog_parse_instruction(struct nv40_vpc *vpc,
tgsi_src(vpc, 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(vpc, fsrc);
+ } else {
+ src[i] = temp(vpc);
+ arith(vpc, 0, OP_MOV, src[i], MASK_ALL,
+ tgsi_src(vpc, fsrc), none, none);
+ }
+ break;
case TGSI_FILE_TEMPORARY:
/* handled above */
break;