vulkan-project/exceptions.cpp
2022-10-07 23:30:44 +02:00

22 lines
567 B
C++

#include "exceptions.hpp"
#include "vk_enum_string.h"
namespace gz {
VkException getVkException(VkResult result, std::string&& what, std::string&& functionName) {
std::string whatStr;
if (!functionName.empty()) {
whatStr += "Error in function: " + functionName + ": ";
}
else {
whatStr += "Error: ";
}
if (!what.empty()) {
whatStr += what + ": ";
}
whatStr += "VkResult=";
whatStr += STR_VK_RESULT(result);
return VkException(whatStr);
}
}