aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl/t_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/tnl/t_draw.c')
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index 6f152ad53..2a11091c8 100644
--- a/mesalib/src/mesa/tnl/t_draw.c
+++ b/mesalib/src/mesa/tnl/t_draw.c
@@ -453,6 +453,7 @@ void _tnl_draw_prims( struct gl_context *ctx,
*/
struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1];
GLuint nr_bo = 0;
+ GLuint inst;
for (i = 0; i < nr_prims;) {
GLuint this_nr_prims;
@@ -470,15 +471,19 @@ void _tnl_draw_prims( struct gl_context *ctx,
/* Binding inputs may imply mapping some vertex buffer objects.
* They will need to be unmapped below.
*/
- bind_prims(ctx, &prim[i], this_nr_prims);
- bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
- bo, &nr_bo);
- bind_indices(ctx, ib, bo, &nr_bo);
+ for (inst = 0; inst < prim[i].num_instances; inst++) {
- TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
+ bind_prims(ctx, &prim[i], this_nr_prims);
+ bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
+ bo, &nr_bo);
+ bind_indices(ctx, ib, bo, &nr_bo);
- unmap_vbos(ctx, bo, nr_bo);
- free_space(ctx);
+ tnl->CurInstance = inst;
+ TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
+
+ unmap_vbos(ctx, bo, nr_bo);
+ free_space(ctx);
+ }
i += this_nr_prims;
}