From 1dc4bbe5f25abd9761ec940051d15a8c3cae9444 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 23 May 2022 12:23:12 +0200 Subject: [PATCH] utils: Report Wine segfault VkResult directly. Signed-off-by: Hans-Kristian Arntzen --- libs/vkd3d/utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index c960c001..cbc2e70a 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -1018,6 +1018,16 @@ HRESULT hresult_from_errno(int rc) HRESULT hresult_from_vk_result(VkResult vr) { + /* Wine tends to dispatch Vulkan calls to their own syscall stack. + * Crashes are captured and return this magic VkResult. + * Report it explicitly here so it's easier to debug when it happens. */ + if (vr == -1073741819) + { + ERR("Detected segfault in Wine syscall handler.\n"); + /* HACK: For ad-hoc debugging can also trigger backtrace printing here. */ + return E_POINTER; + } + switch (vr) { case VK_SUCCESS: