wined3d: Reference vertex buffer objects only after calling context_update_stream_info().
It may load buffers into a different location. Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3ebafc805f
commit
613e163877
|
@ -3963,12 +3963,23 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
|
|||
device_invalidate_state(device, STATE_STREAMSRC);
|
||||
else
|
||||
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. */
|
||||
if (wined3d_context_is_graphics_state_dirty(context, STATE_STREAMSRC))
|
||||
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)
|
||||
{
|
||||
struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(state->index_buffer);
|
||||
|
|
Loading…
Reference in New Issue