=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d10core/tests: Add option to enable debug layer.

Alexandre Julliard julliard at winehq.org
Thu Jan 24 14:42:53 CST 2019


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Jan 24 12:31:24 2019 +0100

d3d10core/tests: Add option to enable debug layer.

Some tests crash with the debug layer enabled.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d10core/tests/d3d10core.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index 54edf50..06b9a16 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -34,6 +34,7 @@
 #define BITS_1_0  0x3f800000
 
 static unsigned int use_adapter_idx;
+static BOOL enable_debug_layer;
 static BOOL use_warp_adapter;
 static BOOL use_mt = TRUE;
 
@@ -1093,20 +1094,24 @@ static IDXGIAdapter *create_adapter(void)
 
 static ID3D10Device *create_device(void)
 {
+    unsigned int flags = 0;
     IDXGIAdapter *adapter;
     ID3D10Device *device;
     HRESULT hr;
 
+    if (enable_debug_layer)
+        flags |= D3D10_CREATE_DEVICE_DEBUG;
+
     adapter = create_adapter();
-    hr = D3D10CreateDevice(adapter, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device);
+    hr = D3D10CreateDevice(adapter, D3D10_DRIVER_TYPE_HARDWARE, NULL, flags, D3D10_SDK_VERSION, &device);
     if (adapter)
         IDXGIAdapter_Release(adapter);
     if (SUCCEEDED(hr))
         return device;
 
-    if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device)))
+    if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, flags, D3D10_SDK_VERSION, &device)))
         return device;
-    if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device)))
+    if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, flags, D3D10_SDK_VERSION, &device)))
         return device;
 
     return NULL;
@@ -17878,7 +17883,9 @@ START_TEST(d3d10core)
     argc = winetest_get_mainargs(&argv);
     for (i = 2; i < argc; ++i)
     {
-        if (!strcmp(argv[i], "--warp"))
+        if (!strcmp(argv[i], "--validate"))
+            enable_debug_layer = TRUE;
+        else if (!strcmp(argv[i], "--warp"))
             use_warp_adapter = TRUE;
         else if (!strcmp(argv[i], "--adapter") && i + 1 < argc)
             use_adapter_idx = atoi(argv[++i]);




More information about the wine-cvs mailing list