summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-04-04 18:22:46 -0600
committerBrian Paul <brianp@vmware.com>2010-04-04 19:05:39 -0600
commit528d100b80f0aaa5f4480c3e42004158763612e9 (patch)
treee6fd05b04f2caf8575e64b35a8458ea83bfe22d6 /src/mesa/state_tracker/st_draw.c
parent3b7ac45162412a79c3cd4d4dbc16bd54db597608 (diff)
st/mesa: call pipe_context::draw_arrays/elements_instanced()
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 7f45e3f548..e0bb1a0af5 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);
+ }
}
}