From: Mikko Rasa Date: Wed, 16 Mar 2022 10:13:48 +0000 (+0200) Subject: Automatically break into debugger on Vulkan errors X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=8d0f0839d1fc5195fce1b77c36e7f3b5b114e696;p=libs%2Fgui.git Automatically break into debugger on Vulkan errors --- diff --git a/source/graphics/vkxlib/vulkancontext.cpp b/source/graphics/vkxlib/vulkancontext.cpp index 3b5476b..ccd9a1e 100644 --- a/source/graphics/vkxlib/vulkancontext.cpp +++ b/source/graphics/vkxlib/vulkancontext.cpp @@ -3,6 +3,7 @@ #define VK_USE_PLATFORM_XLIB_KHR #include #include +#include #include #include "display_private.h" #include "vulkancontext.h" @@ -254,9 +255,11 @@ VulkanContext::Private::Private(): debug_report_callback(0) { } -VkBool32 VulkanContext::Private::debug_report_func(VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *message, void *) +VkBool32 VulkanContext::Private::debug_report_func(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *message, void *) { IO::print(IO::cerr, "%s\n", message); + if((flags&VK_DEBUG_REPORT_ERROR_BIT_EXT) && Debug::check_debugger()==Debug::GDB) + Debug::debug_break(); return VK_FALSE; }