summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-12 15:40:57 -0700
committerBrian Paul <brianp@vmware.com>2010-02-12 15:42:12 -0700
commitff37205f93eaf888e12c6587b8c7cd17d890c4e0 (patch)
tree3a6967d1e4dd1e80fbbd60eeee456a053a6a5661 /src/mesa/state_tracker
parentb9b4e7724e5ae80121a053ca66cee73942cc16b7 (diff)
st/mesa: improved draw_range_elements code
Don't use pipe->draw_range_elements() if min_index=max_index=~0 since that doesn't provide any useful info. Also, implement the loop around pipe->draw_range_elements() when nr_prims > 1.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_draw.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index e1dcb154c1..34df4d48dd 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -645,20 +645,18 @@ st_draw_vbo(GLcontext *ctx,
}
/* draw */
- if (nr_prims == 1 && pipe->draw_range_elements != NULL) {
- i = 0;
-
+ if (pipe->draw_range_elements && min_index != ~0 && max_index != ~0) {
/* XXX: exercise temporary path to pass min/max directly
* through to driver & draw module. These interfaces still
* need a bit of work...
*/
- prim = translate_prim( ctx, prims[i].mode );
+ for (i = 0; i < nr_prims; i++) {
+ prim = translate_prim( ctx, prims[i].mode );
- pipe->draw_range_elements(pipe, indexBuf, indexSize,
- min_index,
- max_index,
- prim,
- prims[i].start + indexOffset, prims[i].count);
+ pipe->draw_range_elements(pipe, indexBuf, indexSize,
+ min_index, max_index, prim,
+ prims[i].start + indexOffset, prims[i].count);
+ }
}
else {
for (i = 0; i < nr_prims; i++) {