diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c index 2c34f35fd78..941d0ddb77c 100644 --- a/src/microsoft/vulkan/dzn_device.c +++ b/src/microsoft/vulkan/dzn_device.c @@ -110,6 +110,7 @@ static const struct debug_control dzn_debug_options[] = { { "signature", DZN_DEBUG_SIG }, { "gbv", DZN_DEBUG_GBV }, { "d3d12", DZN_DEBUG_D3D12 }, + { "debugger", DZN_DEBUG_DEBUGGER }, { NULL, 0 } }; @@ -179,6 +180,13 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo, instance->debug_flags = parse_debug_string(getenv("DZN_DEBUG"), dzn_debug_options); + if (instance->debug_flags & DZN_DEBUG_DEBUGGER) { + /* wait for debugger to attach... */ + while (!IsDebuggerPresent()) { + Sleep(100); + } + } + instance->dxil_validator = dxil_create_validator(NULL); instance->d3d12.serialize_root_sig = d3d12_get_serialize_root_sig(); diff --git a/src/microsoft/vulkan/dzn_private.h b/src/microsoft/vulkan/dzn_private.h index 48bae7a38af..f9142fe389f 100644 --- a/src/microsoft/vulkan/dzn_private.h +++ b/src/microsoft/vulkan/dzn_private.h @@ -920,6 +920,7 @@ enum dzn_debug_flags { DZN_DEBUG_SIG = 1 << 5, DZN_DEBUG_GBV = 1 << 6, DZN_DEBUG_D3D12 = 1 << 7, + DZN_DEBUG_DEBUGGER = 1 << 8, }; struct dzn_instance {