[PATCH 1/5] wined3d: Properly preload index buffers.

Henri Verbeet hverbeet at codeweavers.com
Mon May 28 11:17:25 CDT 2012


We can't do this from device_update_stream_info() because it is only called
when the vertex buffer setup is invalidated. This fixes a regression
introduced by commit 29893d81621b50e3acca1f2c34767867a9256ecb.
---
 dlls/wined3d/context.c |    7 +++++++
 dlls/wined3d/device.c  |   11 ++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index bba4112..4037c41 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2336,6 +2336,13 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
     device_preload_textures(device);
     if (isStateDirty(context, STATE_VDECL) || isStateDirty(context, STATE_STREAMSRC))
         device_update_stream_info(device, context->gl_info);
+    if (state->index_buffer && !state->user_stream)
+    {
+        if (device->strided_streams.all_vbo)
+            wined3d_buffer_preload(state->index_buffer);
+        else
+            buffer_get_sysmem(state->index_buffer, context->gl_info);
+    }
 
     ENTER_GL();
     if (context->last_was_blit)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f154e44..a0fbe86 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -447,15 +447,8 @@ void device_update_stream_info(struct wined3d_device *device, const struct wined
         }
     }
 
-    if (state->index_buffer && !state->user_stream)
-    {
-        if (prev_all_vbo != stream_info->all_vbo)
-            device_invalidate_state(device, STATE_INDEXBUFFER);
-        if (stream_info->all_vbo)
-            wined3d_buffer_preload(state->index_buffer);
-        else
-            buffer_get_sysmem(state->index_buffer, gl_info);
-    }
+    if (prev_all_vbo != stream_info->all_vbo)
+        device_invalidate_state(device, STATE_INDEXBUFFER);
 }
 
 static void device_preload_texture(const struct wined3d_state *state, unsigned int idx)
-- 
1.7.3.4




More information about the wine-patches mailing list