dzn: Add a debug flag to enable D3D12 debug layer
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Mon, 4 Apr 2022 18:45:20 +0000 (14:45 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Apr 2022 18:05:44 +0000 (18:05 +0000)
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15742>

src/microsoft/vulkan/dzn_device.cpp
src/microsoft/vulkan/dzn_private.h

index 215707f..3312a06 100644 (file)
@@ -101,6 +101,7 @@ static const struct debug_control dzn_debug_options[] = {
    { "internal", DZN_DEBUG_INTERNAL },
    { "signature", DZN_DEBUG_SIG },
    { "gbv", DZN_DEBUG_GBV },
+   { "d3d12", DZN_DEBUG_D3D12 },
    { NULL, 0 }
 };
 
@@ -179,7 +180,8 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo,
       return vk_error(NULL, VK_ERROR_INITIALIZATION_FAILED);
    }
 
-   d3d12_enable_debug_layer();
+   if (instance->debug_flags & DZN_DEBUG_D3D12)
+      d3d12_enable_debug_layer();
    if (instance->debug_flags & DZN_DEBUG_GBV)
       d3d12_enable_gpu_validation();
 
index fea0e5e..d6145df 100644 (file)
@@ -934,6 +934,7 @@ enum dzn_debug_flags {
    DZN_DEBUG_INTERNAL = 1 << 4,
    DZN_DEBUG_SIG = 1 << 5,
    DZN_DEBUG_GBV = 1 << 6,
+   DZN_DEBUG_D3D12 = 1 << 7,
 };
 
 struct dzn_instance {