Remove varargs support from LOG_VULKAN_ERROR

Nothing currently uses it. It could theoretically be replaced with fmt support, but I don't think the LOG_VULKAN_ERROR macro is that useful and it'd be better to replace it with regular logging instead.
This commit is contained in:
Pokechu22 2022-10-11 20:10:32 -07:00
parent f9fe25291d
commit ae7b14887b
2 changed files with 6 additions and 13 deletions

View File

@ -205,17 +205,10 @@ const char* VkResultToString(VkResult res)
}
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
const char* msg, ...)
const char* msg)
{
std::va_list ap;
va_start(ap, msg);
std::string real_msg = StringFromFormatV(msg, ap);
va_end(ap);
real_msg = fmt::format("({}) {} ({}: {})", func_name, real_msg, static_cast<int>(res),
VkResultToString(res));
GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "{}", real_msg);
GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "({}) {} ({}: {})", func_name, msg,
static_cast<int>(res), VkResultToString(res));
}
} // namespace Vulkan

View File

@ -48,9 +48,9 @@ void UnloadVulkanLibrary();
const char* VkResultToString(VkResult res);
void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res,
const char* msg, ...);
const char* msg);
#define LOG_VULKAN_ERROR(res, ...) \
LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res __VA_OPT__(, ) __VA_ARGS__)
#define LOG_VULKAN_ERROR(res, msg) \
LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res, msg)
} // namespace Vulkan