Merge pull request #13042 from homeisfar/vk_improve_logger

vulkan: Add line number to vulkan error logger
This commit is contained in:
Tilka 2024-08-31 13:05:28 +01:00 committed by GitHub
commit 157be45d6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -241,10 +241,10 @@ const char* VkResultToString(VkResult res)
}
}
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
const char* msg)
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, const int line,
VkResult res, const char* msg)
{
GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "({}) {} ({}: {})", func_name, msg,
GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "({}:{}) {} ({}: {})", func_name, line, msg,
static_cast<int>(res), VkResultToString(res));
}

View File

@ -95,10 +95,10 @@ bool SupportsCustomDriver();
#endif
const char* VkResultToString(VkResult res);
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
const char* msg);
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, const int line,
VkResult res, const char* msg);
#define LOG_VULKAN_ERROR(res, msg) \
LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res, msg)
LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, __LINE__, res, msg)
} // namespace Vulkan