diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-08-10 11:01:17 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-08-10 14:20:32 -0600 |
| commit | bac430f14a528ec2c46f0ab145ac28fe00cdb152 (patch) | |
| tree | cfddb15b29b8188c924346c3e7dc2ae2ab6618a8 /layers/vk_layer_logging.h | |
| parent | 273c0f252825381eceefd6a7e63d243d3a1205fb (diff) | |
| download | usermoji-bac430f14a528ec2c46f0ab145ac28fe00cdb152.tar.xz | |
layers: GH1991, Implement BREAK debug action
Change-Id: I19ee76db3a380116c7c25819a112751d988e23b4
Diffstat (limited to 'layers/vk_layer_logging.h')
| -rw-r--r-- | layers/vk_layer_logging.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/layers/vk_layer_logging.h b/layers/vk_layer_logging.h index 7cf113bf..7a565645 100644 --- a/layers/vk_layer_logging.h +++ b/layers/vk_layer_logging.h @@ -28,6 +28,7 @@ #include "vk_layer_table.h" #include "vk_loader_platform.h" #include "vulkan/vk_layer.h" +#include <signal.h> #include <cinttypes> #include <stdarg.h> #include <stdbool.h> @@ -35,6 +36,7 @@ #include <unordered_map> #include <vector> + typedef struct _debug_report_data { VkLayerDbgFunctionNode *debug_callback_list; VkLayerDbgFunctionNode *default_debug_callback_list; @@ -399,6 +401,19 @@ static inline VKAPI_ATTR VkBool32 VKAPI_CALL win32_debug_output_msg(VkFlags msgF return false; } +static inline VKAPI_ATTR VkBool32 VKAPI_CALL DebugBreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, + uint64_t srcObject, size_t location, int32_t msgCode, + const char *pLayerPrefix, const char *pMsg, void *pUserData) { +#ifdef WIN32 + DebugBreak(); +#else + raise(SIGTRAP); +#endif + + return false; +} + + // TODO: Could be autogenerated for the specific handles for extra type safety... template <typename HANDLE_T> static inline uint64_t HandleToUint64(HANDLE_T *h) { |
