From db80aba5ad526b8691dace1c4c20b5cbc85389a4 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Fri, 27 Feb 2015 13:18:22 +0100 Subject: [PATCH] wined3d: Drop redundant check for instanced rendering from drawStridedFast. We need GL_ARB_instanced_arrays to be able to take the fastest path and that's already checked in draw_primitive. Note that GL_ARB_instanced_arrays provides glDrawElementsInstanced if GL_ARB_draw_instanced is not supported so we don't need to explicitly check for the latter. --- dlls/wined3d/drawprim.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 98e7cf42e4a..4916c0545d3 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -44,26 +44,19 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit GLenum idxtype = idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; if (instance_count) { - if (!gl_info->supported[ARB_DRAW_INSTANCED] && !gl_info->supported[ARB_INSTANCED_ARRAYS]) + if (start_instance) + FIXME("Start instance (%u) not supported.\n", start_instance); + if (gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) { - FIXME("Instanced drawing not supported.\n"); + GL_EXTCALL(glDrawElementsInstancedBaseVertex(primitive_type, count, idxtype, + (const char *)idx_data + (idx_size * start_idx), instance_count, base_vertex_index)); + checkGLcall("glDrawElementsInstancedBaseVertex"); } else { - if (start_instance) - FIXME("Start instance (%u) not supported.\n", start_instance); - if (gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]) - { - GL_EXTCALL(glDrawElementsInstancedBaseVertex(primitive_type, count, idxtype, - (const char *)idx_data + (idx_size * start_idx), instance_count, base_vertex_index)); - checkGLcall("glDrawElementsInstancedBaseVertex"); - } - else - { - GL_EXTCALL(glDrawElementsInstanced(primitive_type, count, idxtype, - (const char *)idx_data + (idx_size * start_idx), instance_count)); - checkGLcall("glDrawElementsInstanced"); - } + GL_EXTCALL(glDrawElementsInstanced(primitive_type, count, idxtype, + (const char *)idx_data + (idx_size * start_idx), instance_count)); + checkGLcall("glDrawElementsInstanced"); } } else if (gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX])