Added function for checking against VK_SUCCESS, updated error list to latest SDK
This commit is contained in:
parent
25c38e7312
commit
a6a897f244
2 changed files with 25 additions and 2 deletions
|
|
@ -53,7 +53,6 @@ namespace vkTools
|
|||
{
|
||||
switch (errorCode)
|
||||
{
|
||||
// todo : update to SDK 0.10.1
|
||||
#define STR(r) case VK_ ##r: return #r
|
||||
STR(NOT_READY);
|
||||
STR(TIMEOUT);
|
||||
|
|
@ -67,13 +66,34 @@ namespace vkTools
|
|||
STR(ERROR_MEMORY_MAP_FAILED);
|
||||
STR(ERROR_LAYER_NOT_PRESENT);
|
||||
STR(ERROR_EXTENSION_NOT_PRESENT);
|
||||
STR(ERROR_FEATURE_NOT_PRESENT);
|
||||
STR(ERROR_INCOMPATIBLE_DRIVER);
|
||||
STR(ERROR_TOO_MANY_OBJECTS);
|
||||
STR(ERROR_FORMAT_NOT_SUPPORTED);
|
||||
STR(ERROR_SURFACE_LOST_KHR);
|
||||
STR(ERROR_NATIVE_WINDOW_IN_USE_KHR);
|
||||
STR(SUBOPTIMAL_KHR);
|
||||
STR(ERROR_OUT_OF_DATE_KHR);
|
||||
STR(ERROR_INCOMPATIBLE_DISPLAY_KHR);
|
||||
STR(ERROR_VALIDATION_FAILED_EXT);
|
||||
STR(ERROR_INVALID_SHADER_NV);
|
||||
#undef STR
|
||||
default:
|
||||
return "UNKNOWN_ERROR";
|
||||
}
|
||||
}
|
||||
|
||||
VkResult checkResult(VkResult result)
|
||||
{
|
||||
if (result != VK_SUCCESS)
|
||||
{
|
||||
std::string errorMsg = "Fatal : VkResult returned " + errorString(result) + "!";
|
||||
std::cout << errorMsg << std::endl;
|
||||
assert(result == VK_SUCCESS);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
VkBool32 getSupportedDepthFormat(VkPhysicalDevice physicalDevice, VkFormat *depthFormat)
|
||||
{
|
||||
// Since all depth formats may be optional, we need to find a suitable depth format to use
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue