summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-10-17 23:26:57 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-10-21 23:00:39 +0200
commit3637537a1f84b8b3fa07507ea1f503d219cce496 (patch)
treed28912f78371a8f19971edd463c77c4c74c705ca /src/gallium/drivers/nvc0
parent44c23e9052d787f5e87bc028409424f417a15831 (diff)
nvc0: prevent VERTEXID/INSTANCEID from consuming input slots
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index dc46e99a594..7893172ff7a 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -99,11 +99,23 @@ nvc0_shader_output_address(unsigned sn, unsigned si, unsigned ubase)
static int
nvc0_vp_assign_input_slots(struct nv50_ir_prog_info *info)
{
- unsigned i, c;
+ unsigned i, c, n;
- for (i = 0; i < info->numInputs; ++i)
+ for (n = 0, i = 0; i < info->numInputs; ++i) {
+ switch (info->in[i].sn) {
+ case TGSI_SEMANTIC_INSTANCEID:
+ case NV50_SEMANTIC_VERTEXID:
+ info->in[i].mask = 0x1;
+ info->in[i].slot[0] =
+ nvc0_shader_input_address(info->in[i].sn, 0, 0) / 4;
+ continue;
+ default:
+ break;
+ }
for (c = 0; c < 4; ++c)
- info->in[i].slot[c] = (0x80 + i * 0x10 + c * 0x4) / 4;
+ info->in[i].slot[c] = (0x80 + n * 0x10 + c * 0x4) / 4;
+ ++n;
+ }
return 0;
}