summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-05 14:41:08 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-05 14:53:23 +0100
commit533bf171d4c926e4ab6fcd0d51396b195b9e024f (patch)
treead27eee423151586b3573668d1af172be0eff3b4 /src/gallium/drivers/nv50/nv50_program.c
parent17b9b757b704e0dcf370f7ae6e72c6e22601363d (diff)
nv50: support the InstanceID system value
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_program.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 1c1a4201b6..a63f9d8a6d 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -328,10 +328,15 @@ prog_decl(struct nv50_translation_info *ti,
}
break;
case TGSI_FILE_SYSTEM_VALUE:
+ /* For VP/GP inputs, they are put in s[] after the last normal input.
+ * Let sysval_map reflect the order of the sysvals in s[] and fixup later.
+ */
switch (decl->Semantic.Name) {
case TGSI_SEMANTIC_FACE:
break;
case TGSI_SEMANTIC_INSTANCEID:
+ ti->p->vp.attrs[2] |= NV50_3D_VP_GP_BUILTIN_ATTR_EN_INSTANCE_ID;
+ ti->sysval_map[first] = 2;
break;
case TGSI_SEMANTIC_PRIMID:
break;
@@ -392,6 +397,18 @@ nv50_vertprog_prepare(struct nv50_translation_info *ti)
}
}
+ for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
+ switch (ti->sysval_map[i]) {
+ case 2:
+ if (!(ti->p->vp.attrs[2] & NV50_3D_VP_GP_BUILTIN_ATTR_EN_VERTEX_ID))
+ ti->sysval_map[i] = 1;
+ ti->sysval_map[i] = (ti->sysval_map[i] - 1) + num_inputs;
+ break;
+ default:
+ break;
+ }
+ }
+
if (p->vp.psiz < 0x40)
p->vp.psiz = p->out[p->vp.psiz].hw;