From 60b08eb1fdf287d28ec66b9282513ab35a61aee0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 31 Aug 2009 10:13:22 -0700 Subject: 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 --- src/mesa/main/api_noop.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa/main/api_noop.c') diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 66f9c4e6bd..09ba7e5062 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; } -- cgit v1.2.3