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: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c6a6de93123..f264494cb5f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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,