Matteo Bruni : wined3d: Drop redundant check for instanced rendering from drawStridedFast.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Mar 2 08:51:50 CST 2015
Module: wine
Branch: master
Commit: db80aba5ad526b8691dace1c4c20b5cbc85389a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=db80aba5ad526b8691dace1c4c20b5cbc85389a4
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Fri Feb 27 13:18:22 2015 +0100
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 98e7cf4..4916c05 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])
More information about the wine-cvs
mailing list