mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
vulkan: Add line number to vulkan error logger
This is a minor improvement to add line numbers to the LOG_VULKAN_ERROR define. Basically error logs for Vulkan will now look like: ``` // This 25:03:347 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion:278) vkWaitForFences failed: (2: VK_TIMEOUT) // Instead of 15:45:154 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion) vkWaitForFences failed: (2: VK_TIMEOUT) ```
This commit is contained in:
parent
22ed1dddca
commit
02e9a8feaf
@ -241,10 +241,10 @@ const char* VkResultToString(VkResult res)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
|
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, const int line,
|
||||||
const char* msg)
|
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));
|
static_cast<int>(res), VkResultToString(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,10 +95,10 @@ bool SupportsCustomDriver();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* VkResultToString(VkResult res);
|
const char* VkResultToString(VkResult res);
|
||||||
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
|
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, const int line,
|
||||||
const char* msg);
|
VkResult res, const char* msg);
|
||||||
|
|
||||||
#define LOG_VULKAN_ERROR(res, 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
|
} // namespace Vulkan
|
||||||
|
Loading…
x
Reference in New Issue
Block a user