[PATCH 3/3] d3d9/tests: Skip vidmem account test on cards with > 4GB video memory.

Stefan Dösinger stefan at codeweavers.com
Wed Nov 15 16:21:18 CST 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>

---

This avoids a test failure for me on Wine with my new Nvidia Geforce GTX
1060:
device.c:9404: Test failed: Expected available texture memory to
decrease during texture creation.
device.c:9406: Test failed: Expected a video memory difference of at
least 40 MB, got 0 MB.

Note that I don't have Windows yet on my new machine, so I cannot
compare the behavior of d3d9 with too much video memory than it can
report. Ignore this patch for now if that concerns you.
---
 dlls/d3d9/tests/device.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 388cda1d7a..75e3b3e4ec 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -25,6 +25,7 @@
 #define WINVER 0x0602 /* for CURSOR_SUPPRESSED */
 #define COBJMACROS
 #include <d3d9.h>
+#include <limits.h>
 #include "wine/test.h"
 
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
@@ -9389,6 +9390,12 @@ static void test_vidmem_accounting(void)
     }
 
     vidmem_start = IDirect3DDevice9_GetAvailableTextureMem(device);
+    if (vidmem_start == UINT_MAX)
+    {
+        skip("GPU has more video memory than can be reported, skipping vidmem decrease test.\n");
+        goto cleanup;
+    }
+
     memset(textures, 0, sizeof(textures));
     for (i = 0; i < ARRAY_SIZE(textures); i++)
     {
@@ -9412,6 +9419,7 @@ static void test_vidmem_accounting(void)
             IDirect3DTexture9_Release(textures[i]);
     }
 
+cleanup:
     refcount = IDirect3DDevice9_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);
     IDirect3D9_Release(d3d9);
-- 
2.13.6




More information about the wine-devel mailing list