Commit 8c1c83df authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Cap the maximum reported VRAM, not the current reported VRAM.

That is, subtract the currently used memory from the capped maximum, so that creating textures will report that available VRAM has decreased. Drivers on Windows seem to match this behaviour (at least NVidia and WARP), although they vary on where the cap is set. This fixes test failures in test_vidmem_accounting() for cards with over 4 GiB of VRAM. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent eae27293
......@@ -1482,7 +1482,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
wine_dbgstr_longlong(device->adapter->vram_bytes_used),
wine_dbgstr_longlong(driver_info->vram_bytes - device->adapter->vram_bytes_used));
return min(UINT_MAX, driver_info->vram_bytes - device->adapter->vram_bytes_used);
return min(UINT_MAX, driver_info->vram_bytes) - device->adapter->vram_bytes_used;
}
struct wined3d_buffer * CDECL wined3d_device_context_get_stream_output(struct wined3d_device_context *context,
......
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