Commit 613e1638 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Reference vertex buffer objects only after calling context_update_stream_info().

It may load buffers into a different location. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3ebafc80
...@@ -3963,12 +3963,23 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, ...@@ -3963,12 +3963,23 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
device_invalidate_state(device, STATE_STREAMSRC); device_invalidate_state(device, STATE_STREAMSRC);
else else
wined3d_buffer_load(&buffer_gl->b, context, state); wined3d_buffer_load(&buffer_gl->b, context, state);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
} }
/* Loading the buffers above may have invalidated the stream info. */ /* Loading the buffers above may have invalidated the stream info. */
if (wined3d_context_is_graphics_state_dirty(context, STATE_STREAMSRC)) if (wined3d_context_is_graphics_state_dirty(context, STATE_STREAMSRC))
context_update_stream_info(context, state); context_update_stream_info(context, state);
map = context->stream_info.use_map;
while (map)
{
const struct wined3d_stream_info_element *e;
struct wined3d_buffer_gl *buffer_gl;
e = &context->stream_info.elements[wined3d_bit_scan(&map)];
buffer_gl = wined3d_buffer_gl(state->streams[e->stream_idx].buffer);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
}
if (indexed && state->index_buffer) if (indexed && state->index_buffer)
{ {
struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(state->index_buffer); struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(state->index_buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment