summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-29 11:46:43 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-29 11:48:04 +0100
commit82605d7bcd533d7c96cc619c45970efd7229dc3b (patch)
treedd447161d0a5c12ce3350d1fa34bee980f642a44 /src/mesa
parentcb87d7e44a6d6b1b4239b4e38c76c6bb848d2ef6 (diff)
draw: draw_range_elements trial
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_draw.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index a3bffbfc95..551860452a 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -365,14 +365,33 @@ st_draw_vbo(GLcontext *ctx,
}
/* draw */
- for (i = 0; i < nr_prims; i++) {
+ if (nr_prims == 1 && pipe->draw_range_elements != NULL) {
+ i = 0;
+
+ /* XXX: exercise temporary path to pass min/max directly
+ * through to driver & draw module. These interfaces still
+ * need a bit of work...
+ */
setup_edgeflags(ctx, prims[i].mode,
prims[i].start + indexOffset, prims[i].count,
arrays[VERT_ATTRIB_EDGEFLAG]);
- pipe->draw_elements(pipe, indexBuf, indexSize,
- prims[i].mode,
- prims[i].start + indexOffset, prims[i].count);
+ pipe->draw_range_elements(pipe, indexBuf, indexSize,
+ min_index,
+ max_index,
+ prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count);
+ }
+ else {
+ for (i = 0; i < nr_prims; i++) {
+ setup_edgeflags(ctx, prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count,
+ arrays[VERT_ATTRIB_EDGEFLAG]);
+
+ pipe->draw_elements(pipe, indexBuf, indexSize,
+ prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count);
+ }
}
pipe_reference_buffer(pipe, &indexBuf, NULL);