From aa71065d9b4456cfd9099aa5fca70b711f84f217 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 28 May 2012 18:17:25 +0200 Subject: [PATCH] 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 bba4112f410..4037c41217e 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 f154e44eb6a..a0fbe8667be 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)