[PATCH 4/5] wined3d: Fix index offset for immediate mode draws.

Józef Kucia jkucia at codeweavers.com
Mon Oct 24 04:57:27 CDT 2016


This fixes 42fcf202211f62ccec21863b36076c2d5e02c1da. A non-NULL pointer
doesn't imply that the pointer isn't an offset into a buffer object data.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/drawprim.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index bf035ae..36c8d98 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -196,12 +196,10 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const
     if (instance_count)
         FIXME("Instancing not implemented.\n");
 
-    /* Immediate mode drawing can't make use of indices in a vbo - get the
-     * data from the index buffer. If the index buffer has no vbo (not
-     * supported or other reason), or with user pointer drawing idx_data
-     * will be non-NULL. */
-    if (idx_size && !idx_data)
-        idx_data = wined3d_buffer_load_sysmem(state->index_buffer, context);
+    /* Immediate mode drawing can't make use of indices in a VBO - get the
+     * data from the index buffer. */
+    if (idx_size)
+        idx_data = wined3d_buffer_load_sysmem(state->index_buffer, context) + state->index_offset;
 
     ops = &d3d_info->ffp_attrib_ops;
 
-- 
2.7.3




More information about the wine-patches mailing list