[PATCH 6/7] wined3d: Subtract framebuffer size from vidmem amount for older Windows versions.
Józef Kucia
jkucia at codeweavers.com
Thu Dec 15 06:45:10 CST 2016
This extends workaround introduced by commit
565a5715468fa990cf9e7cbfe38ac59ddcde1e76.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
For bug 40477.
This workaround is still not enough when some of the affected apps are
run with very high resolutions, but I don't want to limit the total
vidmem too much just because of a few broken apps.
---
dlls/wined3d/directx.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 1aae20d..857d8e3 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
+#define MAX_FRAMEBUFFER_VIDMEM (1920 * 1200 * 4)
#define WINE_DEFAULT_VIDMEM (64 * 1024 * 1024)
#define DEFAULT_REFRESH_RATE 0
@@ -1605,15 +1606,21 @@ static void init_driver_info(struct wined3d_driver_info *driver_info,
driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024;
driver = gpu_desc->driver;
- /**
- * Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff.
- * In order to avoid this application bug we limit the amount of video memory
- * to LONG_MAX for older Windows versions.
+ /* Diablo 2 crashes when the amount of video memory is greater than
+ * 0x7fffffff. Additionally, other applications (e.g. 3DMark 2000) assumes
+ * that the reported amount of video memory doesn't include the memory used
+ * by the default framebuffer. These apps add the estimated framebuffer
+ * memory size to the returned amount of video memory, and then use signed
+ * comparison to check if the amount of memory is above the minimal
+ * requirements. In order to make the mentioned applications work on Wine
+ * with newer GPUs we limit the amount of video memory for older Windows
+ * versions.
*/
- if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX)
+ if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX - MAX_FRAMEBUFFER_VIDMEM)
{
- TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
- driver_info->vram_bytes = LONG_MAX;
+ driver_info->vram_bytes = LONG_MAX - MAX_FRAMEBUFFER_VIDMEM;
+ TRACE("Limiting amount of video memory to %s bytes for OS version older than Vista.\n",
+ wine_dbgstr_longlong(driver_info->vram_bytes));
}
/* Try to obtain driver version information for the current Windows version. This fails in
--
2.7.3
More information about the wine-patches
mailing list