More changes for VK 1.4.304

This commit is contained in:
Georg Hagen
2025-01-26 23:16:11 +01:00
parent 5c1005ea79
commit 0632ebfa7e

View File

@@ -52,12 +52,28 @@ namespace OpenVulkano::Vulkan
return layers; return layers;
} }
VkBool32 ValidationLayerCallback(
#if VK_HEADER_VERSION > 303 #if VK_HEADER_VERSION > 303
vk::Flags<vk::DebugReportFlagBitsEXT> flags, vk::DebugReportObjectTypeEXT objType, VkBool32 ValidationLayerCallback(vk::DebugReportFlagsEXT flags, vk::DebugReportObjectTypeEXT objType,
uint64_t srcObject, size_t location, int32_t msgCode, const char* layerPrefix,
const char* msg, void* pUserData)
{
std::string prefix = "VK_DEBUG:";
spdlog::level::level_enum level = spdlog::level::info;
if (flags & vk::DebugReportFlagBitsEXT::eError) level = spdlog::level::err;
else if (flags & vk::DebugReportFlagBitsEXT::eWarning) level = spdlog::level::warn;
else if (flags & vk::DebugReportFlagBitsEXT::ePerformanceWarning)
{
level = spdlog::level::warn;
prefix = "[PERF] " + prefix;
}
else if (flags & vk::DebugReportFlagBitsEXT::eDebug) level = spdlog::level::debug;
Logger::RENDER->log(level, "{0} [{1}] Code {2}: {3}", prefix, layerPrefix, msgCode, msg);
return false;
}
#else #else
VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, VkBool32 ValidationLayerCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType,
#endif
uint64_t srcObject, size_t location, int32_t msgCode, const char* layerPrefix, uint64_t srcObject, size_t location, int32_t msgCode, const char* layerPrefix,
const char* msg, void* pUserData) const char* msg, void* pUserData)
{ {
@@ -76,6 +92,7 @@ namespace OpenVulkano::Vulkan
return false; return false;
} }
#endif
namespace namespace
{ {