#include "logging.h"
#include <csignal>
#include <cstring>
#ifdef VK_USE_PLATFORM_WIN32_KHR
#include <debugapi.h>
#endif
#include <vulkan/vk_enum_string_helper.h>
#include <vulkan/utility/vk_safe_struct.hpp>
#include "generated/vk_validation_error_messages.h"
#include "error_location.h"
#include "utils/hash_util.h"
#include "vk_layer_config.h"
[[maybe_unused]] const char *kVUIDUndefined = …;
static inline void DebugReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, VkDebugUtilsMessageSeverityFlagsEXT *da_severity,
VkDebugUtilsMessageTypeFlagsEXT *da_type) { … }
void DebugReport::SetDebugUtilsSeverityFlags(std::vector<VkLayerDbgFunctionState> &callbacks) { … }
void DebugReport::RemoveDebugUtilsCallback(uint64_t callback) { … }
bool DebugReport::UpdateLogMsgCounts(int32_t vuid_hash) const { … }
bool DebugReport::DebugLogMsg(VkFlags msg_flags, const LogObjectList &objects, const char *msg, const char *text_vuid) const { … }
void DebugReport::SetUtilsObjectName(const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { … }
void DebugReport::SetMarkerObjectName(const VkDebugMarkerObjectNameInfoEXT *pNameInfo) { … }
std::string DebugReport::GetUtilsObjectNameNoLock(const uint64_t object) const { … }
std::string DebugReport::GetMarkerObjectNameNoLock(const uint64_t object) const { … }
std::string DebugReport::FormatHandle(const char *handle_type_name, uint64_t handle) const { … }
template <typename Map>
static LoggingLabelState *GetLoggingLabelState(Map *map, typename Map::key_type key, bool insert) { … }
void DebugReport::BeginQueueDebugUtilsLabel(VkQueue queue, const VkDebugUtilsLabelEXT *label_info) { … }
void DebugReport::EndQueueDebugUtilsLabel(VkQueue queue) { … }
void DebugReport::InsertQueueDebugUtilsLabel(VkQueue queue, const VkDebugUtilsLabelEXT *label_info) { … }
void DebugReport::BeginCmdDebugUtilsLabel(VkCommandBuffer command_buffer, const VkDebugUtilsLabelEXT *label_info) { … }
void DebugReport::EndCmdDebugUtilsLabel(VkCommandBuffer command_buffer) { … }
void DebugReport::InsertCmdDebugUtilsLabel(VkCommandBuffer command_buffer, const VkDebugUtilsLabelEXT *label_info) { … }
void DebugReport::ResetCmdDebugUtilsLabel(VkCommandBuffer command_buffer) { … }
void DebugReport::EraseCmdDebugUtilsLabel(VkCommandBuffer command_buffer) { … }
VKAPI_ATTR void LayerDebugUtilsDestroyInstance(DebugReport *debug_report) { … }
template <typename TCreateInfo, typename TCallback>
static void LayerCreateCallback(DebugCallbackStatusFlags callback_status, DebugReport *debug_report, const TCreateInfo *create_info,
TCallback *callback) { … }
VKAPI_ATTR VkResult LayerCreateMessengerCallback(DebugReport *debug_report, bool default_callback,
const VkDebugUtilsMessengerCreateInfoEXT *create_info,
VkDebugUtilsMessengerEXT *messenger) { … }
VKAPI_ATTR VkResult LayerCreateReportCallback(DebugReport *debug_report, bool default_callback,
const VkDebugReportCallbackCreateInfoEXT *create_info,
VkDebugReportCallbackEXT *callback) { … }
VKAPI_ATTR void ActivateInstanceDebugCallbacks(DebugReport *debug_report) { … }
VKAPI_ATTR void DeactivateInstanceDebugCallbacks(DebugReport *debug_report) { … }
bool DebugReport::LogMsgEnabled(std::string_view vuid_text, VkDebugUtilsMessageSeverityFlagsEXT msg_severity,
VkDebugUtilsMessageTypeFlagsEXT msg_type) { … }
bool DebugReport::LogMsg(VkFlags msg_flags, const LogObjectList &objects, const Location &loc, std::string_view vuid_text,
const char *format, va_list argptr) { … }
VKAPI_ATTR VkBool32 VKAPI_CALL MessengerBreakCallback([[maybe_unused]] VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
[[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT message_type,
[[maybe_unused]] const VkDebugUtilsMessengerCallbackDataEXT *callback_data,
[[maybe_unused]] void *user_data) { … }
VKAPI_ATTR VkBool32 VKAPI_CALL MessengerLogCallback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
VkDebugUtilsMessageTypeFlagsEXT message_type,
const VkDebugUtilsMessengerCallbackDataEXT *callback_data, void *user_data) { … }
VKAPI_ATTR VkBool32 VKAPI_CALL MessengerWin32DebugOutputMsg(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
VkDebugUtilsMessageTypeFlagsEXT message_type,
const VkDebugUtilsMessengerCallbackDataEXT *callback_data,
[[maybe_unused]] void *user_data) { … }