Commit 307b2003 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Do not track dirty ranges for buffers without WINED3D_BUFFER_USE_BO.

Since we never upload the buffer, and may very well never invalidate the whole thing, this just results in continually increasing memory consumption. This is especially a problem for our internal push constant buffers, which are sysmem buffers that usually are never wholly invalidated, but it could also potentially be a problem for other buffers.
parent 8378a786
...@@ -122,7 +122,7 @@ static void wined3d_buffer_invalidate_range(struct wined3d_buffer *buffer, DWORD ...@@ -122,7 +122,7 @@ static void wined3d_buffer_invalidate_range(struct wined3d_buffer *buffer, DWORD
TRACE("buffer %p, location %s, offset %u, size %u.\n", TRACE("buffer %p, location %s, offset %u, size %u.\n",
buffer, wined3d_debug_location(location), offset, size); buffer, wined3d_debug_location(location), offset, size);
if (location & WINED3D_LOCATION_BUFFER) if ((location & WINED3D_LOCATION_BUFFER) && (buffer->flags & WINED3D_BUFFER_USE_BO))
buffer_invalidate_bo_range(buffer, offset, size); buffer_invalidate_bo_range(buffer, offset, size);
buffer->locations &= ~location; buffer->locations &= ~location;
...@@ -1399,7 +1399,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d ...@@ -1399,7 +1399,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
if (!wined3d_array_reserve((void **)&buffer->dirty_ranges, if ((buffer->flags & WINED3D_BUFFER_USE_BO) && !wined3d_array_reserve((void **)&buffer->dirty_ranges,
&buffer->dirty_ranges_capacity, 1, sizeof(*buffer->dirty_ranges))) &buffer->dirty_ranges_capacity, 1, sizeof(*buffer->dirty_ranges)))
{ {
ERR("Out of memory.\n"); ERR("Out of memory.\n");
......
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