=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Fix index offset for immediate mode draws.

Alexandre Julliard julliard at winehq.org
Mon Oct 24 15:57:55 CDT 2016


Module: wine
Branch: master
Commit: 0581d8614784cd24340123eae520159aeb40ec0f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0581d8614784cd24340123eae520159aeb40ec0f

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Oct 24 11:57:27 2016 +0200

wined3d: Fix index offset for immediate mode draws.

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>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;
 




More information about the wine-cvs mailing list