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

Alexandre Julliard julliard at winehq.org
Wed Jun 8 15:56:05 CDT 2022


Module: wine
Branch: master
Commit: 8c1c83dfdf73096312df7d8225d304dece057fe9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8c1c83dfdf73096312df7d8225d304dece057fe9

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Tue Jun  7 16:32:57 2022 -0500

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: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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,




More information about the wine-cvs mailing list