Commit efdb898b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Evict system memory for dynamic buffers on the first WINED3D_MAP_DISCARD map.

Mostly to avoid making things worse for applications that map dynamic buffers without WINED3D_MAP_DISCARD/WINED3D_MAP_NOOVERWRITE. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a5f7aff3
......@@ -994,8 +994,9 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *
}
wined3d_buffer_validate_location(buffer, WINED3D_LOCATION_BUFFER);
if (buffer->resource.heap_memory)
if (buffer->resource.heap_memory && !(buffer->resource.usage & WINED3DUSAGE_DYNAMIC))
wined3d_buffer_evict_sysmem(buffer);
}
struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
......@@ -1055,6 +1056,9 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI
if (!(flags & WINED3D_MAP_READONLY))
buffer_invalidate_bo_range(buffer, dirty_offset, dirty_size);
if ((flags & WINED3D_MAP_DISCARD) && buffer->resource.heap_memory)
wined3d_buffer_evict_sysmem(buffer);
if (count == 1)
{
const struct wined3d_gl_info *gl_info;
......
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