forked from blender/blender
Node panels: Enable new node group interfaces #1
@ -73,6 +73,7 @@ namespace blender::gpu::debug {
|
|||||||
|
|
||||||
void VKDebuggingTools::init(VkInstance vk_instance)
|
void VKDebuggingTools::init(VkInstance vk_instance)
|
||||||
{
|
{
|
||||||
|
|
||||||
PFN_vkGetInstanceProcAddr instance_proc_addr = vkGetInstanceProcAddr;
|
PFN_vkGetInstanceProcAddr instance_proc_addr = vkGetInstanceProcAddr;
|
||||||
enabled = false;
|
enabled = false;
|
||||||
vk_debug_utils_messenger = nullptr;
|
vk_debug_utils_messenger = nullptr;
|
||||||
@ -248,6 +249,7 @@ void VKDebuggingTools::print_labels(const VkDebugUtilsMessengerCallbackDataEXT *
|
|||||||
ss << std::endl;
|
ss << std::endl;
|
||||||
printf("%s", ss.str().c_str());
|
printf("%s", ss.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
VKAPI_ATTR VkBool32 VKAPI_CALL
|
VKAPI_ATTR VkBool32 VKAPI_CALL
|
||||||
messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
|
messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
|
||||||
VkDebugUtilsMessageTypeFlagsEXT /* message_type*/,
|
VkDebugUtilsMessageTypeFlagsEXT /* message_type*/,
|
||||||
@ -263,71 +265,44 @@ messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
|
|||||||
if (debugging_tools.is_ignore(callback_data->messageIdNumber)) {
|
if (debugging_tools.is_ignore(callback_data->messageIdNumber)) {
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
}
|
}
|
||||||
bool use_color = CLG_color_support_get(&LOG);
|
|
||||||
UNUSED_VARS(use_color);
|
CLG_Severity severity = CLG_SEVERITY_INFO;
|
||||||
bool enabled = false;
|
if (message_severity & (VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT |
|
||||||
if ((message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) ||
|
VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT))
|
||||||
(message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT))
|
|
||||||
{
|
{
|
||||||
if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level >= CLG_SEVERITY_INFO)) {
|
severity = CLG_SEVERITY_INFO;
|
||||||
const char *format = "{0x%x}% s\n %s ";
|
|
||||||
CLG_logf(LOG.type,
|
|
||||||
CLG_SEVERITY_INFO,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
format,
|
|
||||||
callback_data->messageIdNumber,
|
|
||||||
callback_data->pMessageIdName,
|
|
||||||
callback_data->pMessage);
|
|
||||||
enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
if (message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) {
|
||||||
CLG_Severity clog_severity;
|
severity = CLG_SEVERITY_WARN;
|
||||||
switch (message_severity) {
|
|
||||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
|
||||||
clog_severity = CLG_SEVERITY_WARN;
|
|
||||||
break;
|
|
||||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
|
|
||||||
clog_severity = CLG_SEVERITY_ERROR;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
BLI_assert_unreachable();
|
|
||||||
}
|
|
||||||
enabled = true;
|
|
||||||
if (clog_severity == CLG_SEVERITY_ERROR) {
|
|
||||||
const char *format = " %s {0x%x}\n %s ";
|
|
||||||
CLG_logf(LOG.type,
|
|
||||||
clog_severity,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
format,
|
|
||||||
callback_data->pMessageIdName,
|
|
||||||
callback_data->messageIdNumber,
|
|
||||||
callback_data->pMessage);
|
|
||||||
}
|
|
||||||
else if (LOG.type->level >= CLG_SEVERITY_WARN) {
|
|
||||||
const char *format = " %s {0x%x}\n %s ";
|
|
||||||
CLG_logf(LOG.type,
|
|
||||||
clog_severity,
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
format,
|
|
||||||
callback_data->pMessageIdName,
|
|
||||||
callback_data->messageIdNumber,
|
|
||||||
callback_data->pMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((enabled) && ((callback_data->objectCount > 0) || (callback_data->cmdBufLabelCount > 0) ||
|
if (message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {
|
||||||
(callback_data->queueLabelCount > 0)))
|
severity = CLG_SEVERITY_ERROR;
|
||||||
{
|
}
|
||||||
|
|
||||||
|
if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level <= severity)) {
|
||||||
|
const char *format = "{0x%x}% s\n %s ";
|
||||||
|
CLG_logf(LOG.type,
|
||||||
|
severity,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
format,
|
||||||
|
callback_data->messageIdNumber,
|
||||||
|
callback_data->pMessageIdName,
|
||||||
|
callback_data->pMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool do_labels = (callback_data->objectCount + callback_data->cmdBufLabelCount +
|
||||||
|
callback_data->queueLabelCount) > 0;
|
||||||
|
if (do_labels) {
|
||||||
debugging_tools.print_labels(callback_data);
|
debugging_tools.print_labels(callback_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
VkResult VKDebuggingTools::init_messenger(VkInstance vk_instance)
|
VkResult VKDebuggingTools::init_messenger(VkInstance vk_instance)
|
||||||
{
|
{
|
||||||
|
CLG_logref_init(&LOG);
|
||||||
vk_message_id_number_ignored.clear();
|
vk_message_id_number_ignored.clear();
|
||||||
BLI_assert(enabled);
|
BLI_assert(enabled);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user