Henri Verbeet : wined3d: Properly preload index buffers.

Alexandre Julliard julliard at winehq.org
Tue May 29 13:58:02 CDT 2012


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon May 28 18:17:25 2012 +0200

wined3d: Properly preload index buffers.

---

 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)




More information about the wine-cvs mailing list