dzn: add a debug-flag to wait for the debugger
It's geneunely useful to wait for the debugger to attach in some cases. So let's add a debug-flag and staill untik the debugger has attached. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16640>
This commit is contained in:

committed by
Marge Bot

parent
19044cf1de
commit
9f3a5b4313
@@ -110,6 +110,7 @@ static const struct debug_control dzn_debug_options[] = {
|
|||||||
{ "signature", DZN_DEBUG_SIG },
|
{ "signature", DZN_DEBUG_SIG },
|
||||||
{ "gbv", DZN_DEBUG_GBV },
|
{ "gbv", DZN_DEBUG_GBV },
|
||||||
{ "d3d12", DZN_DEBUG_D3D12 },
|
{ "d3d12", DZN_DEBUG_D3D12 },
|
||||||
|
{ "debugger", DZN_DEBUG_DEBUGGER },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -179,6 +180,13 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo,
|
|||||||
instance->debug_flags =
|
instance->debug_flags =
|
||||||
parse_debug_string(getenv("DZN_DEBUG"), dzn_debug_options);
|
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->dxil_validator = dxil_create_validator(NULL);
|
||||||
instance->d3d12.serialize_root_sig = d3d12_get_serialize_root_sig();
|
instance->d3d12.serialize_root_sig = d3d12_get_serialize_root_sig();
|
||||||
|
|
||||||
|
@@ -920,6 +920,7 @@ enum dzn_debug_flags {
|
|||||||
DZN_DEBUG_SIG = 1 << 5,
|
DZN_DEBUG_SIG = 1 << 5,
|
||||||
DZN_DEBUG_GBV = 1 << 6,
|
DZN_DEBUG_GBV = 1 << 6,
|
||||||
DZN_DEBUG_D3D12 = 1 << 7,
|
DZN_DEBUG_D3D12 = 1 << 7,
|
||||||
|
DZN_DEBUG_DEBUGGER = 1 << 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dzn_instance {
|
struct dzn_instance {
|
||||||
|
Reference in New Issue
Block a user