Merge branch 'draw-instanced'
[mesa.git] / src / gallium / auxiliary / draw / draw_vs_exec.c
index 667eb50785570d8210735541220e5b2f72427db7..c41d7c42a018e20ff58aafe47b89894210eec249 100644 (file)
@@ -99,6 +99,12 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
    tgsi_exec_set_constant_buffers(machine, PIPE_MAX_CONSTANT_BUFFERS,
                                   constants, const_size);
 
+   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 (i = 0; i < count; i += MAX_TGSI_VERTICES) {
       unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i);