22 lines
567 B
C++
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);
|
|
}
|
|
}
|