diff options
author | Pierre-Eric Pelloux-Prayer <[email protected]> | 2011-05-31 13:33:54 +0200 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-06-02 17:55:48 -0600 |
commit | 09201cc7a0c4c50871bb8aa5d00ac70aa4e9e670 (patch) | |
tree | 909a5789f5fb355f1b4dfd569d0f93b66ff7ca89 /src/mesa/vbo | |
parent | 0dae94610e0b70b353fd0b018833bb7c8d013abb (diff) |
mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index a49cd5017a3..5e9b2798c43 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -1045,13 +1045,37 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(type), indices, numInstances); if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, - numInstances)) + numInstances, 0)) return; vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, count, type, indices, 0, numInstances); } +/** + * Called by glDrawElementsInstancedBaseVertex() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLsizei numInstances, + GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElementsInstancedBaseVertex(%s, %d, %s, %p, %d; %d)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices, + numInstances, basevertex); + + if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, + numInstances, basevertex)) + return; + + vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, + count, type, indices, basevertex, numInstances); +} + /** * Inner support for both _mesa_MultiDrawElements() and @@ -1260,6 +1284,7 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced; exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced; + exec->vtxfmt.DrawElementsInstancedBaseVertex = vbo_exec_DrawElementsInstancedBaseVertex; } |