summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_noop.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-08-31 10:13:22 -0700
committerEric Anholt <[email protected]>2009-09-01 20:35:19 -0700
commit60b08eb1fdf287d28ec66b9282513ab35a61aee0 (patch)
tree0230f446c99b4957f146289c7295e019e0670ed7 /src/mesa/main/api_noop.c
parenta82cd55a5cb1ad617960551560b107edffad1e9a (diff)
mesa: Make MultiDrawElements submit multiple primitives at once.
Previously, MultiDrawElements just called DrawElements a bunch of times. By sending several primitives down the pipeline at once, we avoid a bunch of validation. On my GL demo, this improves fps by 2.5% (+/- .41%) and reduces CPU usage by 70.5% (+/- 2.9%) (n=3). Reviewed by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/api_noop.c')
-rw-r--r--src/mesa/main/api_noop.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c
index 66f9c4e6bdb..09ba7e50622 100644
--- a/src/mesa/main/api_noop.c
+++ b/src/mesa/main/api_noop.c
@@ -772,6 +772,20 @@ _mesa_noop_DrawRangeElements(GLenum mode,
CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices));
}
+/* GL_EXT_multi_draw_arrays */
+void GLAPIENTRY
+_mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount)
+{
+ GLsizei i;
+
+ for (i = 0; i < primcount; i++) {
+ if (count[i] > 0) {
+ CALL_DrawElements(GET_DISPATCH(), (mode, count[i], type, indices[i]));
+ }
+ }
+}
+
/*
* Eval Mesh
*/
@@ -980,6 +994,7 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
vfmt->DrawArrays = _mesa_noop_DrawArrays;
vfmt->DrawElements = _mesa_noop_DrawElements;
vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
+ vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
vfmt->EvalMesh1 = _mesa_noop_EvalMesh1;
vfmt->EvalMesh2 = _mesa_noop_EvalMesh2;
}