Commit 4aea3618 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Validate WINED3D_LOCATION_BUFFER on WINED3D_MAP_DISCARD buffer maps.

Usually when doing a WINED3D_MAP_DISCARD map on a buffer with a buffer object WINED3D_LOCATION_BUFFER will already be current. However, if the previous map on that buffer loaded WINED3D_LOCATION_SYSMEM, that's not necessarily true. This also brings the code further in line with the corresponding code for textures. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 67007e01
......@@ -1054,7 +1054,9 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI
context = context_acquire(device, NULL, 0);
gl_info = context->gl_info;
if (!(flags & WINED3D_MAP_DISCARD))
if (flags & WINED3D_MAP_DISCARD)
wined3d_buffer_validate_location(buffer, WINED3D_LOCATION_BUFFER);
else
wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_BUFFER);
if (!(flags & WINED3D_MAP_READONLY))
......
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