summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-01-05 16:59:24 +0000
committerDave Airlie <[email protected]>2012-01-11 07:13:35 +0000
commit34a78b7ef6b0edf217acf221eab4b63542be5552 (patch)
tree8c2ee9200fe4b1ed720bec572c722aefd6c40106 /src/gallium/auxiliary/draw
parent02932f37fa030f2d438b599106651cb938c3edc9 (diff)
tgsi/softpipe: add VertexID support.
This required changing the system value semantics, so we stored a system value per vertex, instance id is the only other system value we currently support, so I span it across the channels. This passes the 3 vertexid-* piglit tests + lots of instanceid tests. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index 3f89881534b..bfe7aea737b 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -103,7 +103,8 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
if (shader->info.uses_instanceid) {
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INSTANCEID];
assert(i < Elements(machine->SystemValue));
- machine->SystemValue[i][0] = shader->draw->instance_id;
+ for (j = 0; j < QUAD_SIZE; j++)
+ machine->SystemValue[i].i[j] = shader->draw->instance_id;
}
for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
@@ -123,6 +124,12 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
}
#endif
+ if (shader->info.uses_vertexid) {
+ unsigned vid = machine->SysSemanticToIndex[TGSI_SEMANTIC_VERTEXID];
+ assert(vid < Elements(machine->SystemValue));
+ machine->SystemValue[vid].i[j] = i + j;
+ }
+
for (slot = 0; slot < shader->info.num_inputs; slot++) {
#if 0
assert(!util_is_inf_or_nan(input[slot][0]));