=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: tests: Add option to enable GPU-based validation.

Alexandre Julliard julliard at winehq.org
Fri Aug 2 14:24:34 CDT 2019


Module: vkd3d
Branch: master
Commit: 55f64cef2fa4213302027852fe575a38b75255da
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=55f64cef2fa4213302027852fe575a38b75255da

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Aug  1 18:10:57 2019 +0200

tests: Add option to enable GPU-based validation.

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>

---

 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 2b395aa..067db8d 100644
--- a/include/vkd3d_d3d12.idl
+++ b/include/vkd3d_d3d12.idl
@@ -2330,6 +2330,19 @@ interface ID3D12Debug : IUnknown
 }
 
 [
+    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,
     local,
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h
index fbc0e3d..1f7e764 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)))




More information about the wine-cvs mailing list