draw: setup instance ID for SSE generator
authorBrian Paul <brianp@vmware.com>
Thu, 9 Dec 2010 02:00:44 +0000 (19:00 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 9 Dec 2010 02:00:44 +0000 (19:00 -0700)
src/gallium/auxiliary/draw/draw_vs_sse.c

index 0b0c6077c6f07a3fd05c715d6e284dd6daf505cf..672efe25ccaa590b0e2a13fa483b269e80c2a92f 100644 (file)
@@ -71,6 +71,12 @@ vs_sse_prepare( struct draw_vertex_shader *base,
    struct tgsi_exec_machine *machine = shader->machine;
 
    machine->Samplers = draw->vs.samplers;
+
+   if (base->info.uses_instanceid) {
+      unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INSTANCEID];
+      assert(i < Elements(machine->SystemValue));
+      machine->SystemValue[i][0] = base->draw->instance_id;
+   }
 }