From: Brian Paul Date: Mon, 5 Apr 2010 00:22:46 +0000 (-0600) Subject: st/mesa: call pipe_context::draw_arrays/elements_instanced() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=528d100b80f0aaa5f4480c3e42004158763612e9;p=mesa.git st/mesa: call pipe_context::draw_arrays/elements_instanced() --- diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 7f45e3f5484..e0bb1a0af52 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -669,9 +669,17 @@ st_draw_vbo(GLcontext *ctx, for (i = 0; i < nr_prims; i++) { prim = translate_prim( ctx, prims[i].mode ); - pipe->draw_elements(pipe, indexBuf, indexSize, - prim, - prims[i].start + indexOffset, prims[i].count); + if (prims[i].num_instances == 1) { + pipe->draw_elements(pipe, indexBuf, indexSize, prim, + prims[i].start + indexOffset, + prims[i].count); + } + else { + pipe->draw_elements_instanced(pipe, indexBuf, indexSize, prim, + prims[i].start + indexOffset, + prims[i].count, + 0, prims[i].num_instances); + } } } @@ -685,7 +693,14 @@ st_draw_vbo(GLcontext *ctx, for (i = 0; i < nr_prims; i++) { prim = translate_prim( ctx, prims[i].mode ); - pipe->draw_arrays(pipe, prim, prims[i].start, prims[i].count); + if (prims[i].num_instances == 1) { + pipe->draw_arrays(pipe, prim, prims[i].start, prims[i].count); + } + else { + pipe->draw_arrays_instanced(pipe, prim, prims[i].start, + prims[i].count, + 0, prims[i].num_instances); + } } }