summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorAli Homafar <home.isfar@gmail.com>2024-08-28 17:42:54 -0400
committerAli Homafar <home.isfar@gmail.com>2024-08-28 17:42:54 -0400
commit02e9a8feaf465bdafe7b9c4ce8219d89a115d8ce (patch)
tree317cc7bf5c314409c6f6b32b571183c100560c12 /Source/Core/VideoBackends
parent22ed1dddca72d7e2d29efdc287238e17b36a82f0 (diff)
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) ```
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp6
-rw-r--r--Source/Core/VideoBackends/Vulkan/VulkanLoader.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp b/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp
index 34c531fc2f..46d8468960 100644
--- a/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp
@@ -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));
}
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanLoader.h b/Source/Core/VideoBackends/Vulkan/VulkanLoader.h
index e4c8f9e8a6..cb9a91e1b3 100644
--- a/Source/Core/VideoBackends/Vulkan/VulkanLoader.h
+++ b/Source/Core/VideoBackends/Vulkan/VulkanLoader.h
@@ -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