[PATCH vkd3d 1/2] tests: Add option to enable GPU-based validation.

Józef Kucia joseph.kucia at gmail.com
Thu Aug 1 11:10:57 CDT 2019


From: Józef Kucia <jkucia at codeweavers.com>

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 include/vkd3d_d3d12.idl | 13 +++++++++++++
 tests/d3d12_crosstest.h | 19 ++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl
index 2b395aa1bb4e..067db8da2ad6 100644
--- a/include/vkd3d_d3d12.idl
+++ b/include/vkd3d_d3d12.idl
@@ -2329,6 +2329,19 @@ interface ID3D12Debug : IUnknown
     void EnableDebugLayer();
 }
 
+[
+    uuid(affaa4ca-63fe-4d8e-b8ad-159000af4304),
+    object,
+    local,
+    pointer_default(unique)
+]
+interface ID3D12Debug1 : IUnknown
+{
+    void EnableDebugLayer();
+    void SetEnableGPUBasedValidation(BOOL enable);
+    void SetEnableSynchronizedCommandQueueValidation(BOOL enable);
+}
+
 [
     uuid(34ab647b-3cc8-46ac-841b-c0965645c046),
     object,
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h
index fbc0e3de795d..1f7e7648983f 100644
--- a/tests/d3d12_crosstest.h
+++ b/tests/d3d12_crosstest.h
@@ -647,7 +647,8 @@ static void parse_args(int argc, char **argv)
 
 static void enable_d3d12_debug_layer(int argc, char **argv)
 {
-    bool enable_debug_layer = false;
+    bool enable_debug_layer = false, enable_gpu_based_validation = false;
+    ID3D12Debug1 *debug1;
     ID3D12Debug *debug;
     unsigned int i;
 
@@ -655,6 +656,22 @@ static void enable_d3d12_debug_layer(int argc, char **argv)
     {
         if (!strcmp(argv[i], "--validate"))
             enable_debug_layer = true;
+        else if (!strcmp(argv[i], "--gbv"))
+            enable_gpu_based_validation = true;
+    }
+
+    if (enable_gpu_based_validation)
+    {
+        if (SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug1, (void **)&debug1)))
+        {
+            ID3D12Debug1_SetEnableGPUBasedValidation(debug1, true);
+            ID3D12Debug1_Release(debug1);
+            enable_debug_layer = true;
+        }
+        else
+        {
+            trace("Failed to enable GPU-based validation.\n");
+        }
     }
 
     if (enable_debug_layer && SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
-- 
2.21.0




More information about the wine-devel mailing list