Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions vulkan/vulkan_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,10 @@ std::string VulkanResultToString(VkResult result) {
return "VK_ERROR_INVALID_EXTERNAL_HANDLE";
case VK_ERROR_OUT_OF_POOL_MEMORY:
return "VK_ERROR_OUT_OF_POOL_MEMORY";

#if VK_HEADER_VERSION >= 63
case VK_ERROR_NOT_PERMITTED_EXT:
return "VK_ERROR_NOT_PERMITTED_EXT";
#endif

#if VK_HEADER_VERSION >= 72
case VK_ERROR_FRAGMENTATION_EXT:
return "VK_ERROR_FRAGMENTATION_EXT";
#endif

#if OS_FUCHSIA
#if VK_KHR_external_memory
case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR:
return "VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR";
#elif VK_KHX_external_memory
case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX:
return "VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX";
#endif
case VK_ERROR_OUT_OF_POOL_MEMORY_KHR:
return "VK_ERROR_OUT_OF_POOL_MEMORY_KHR";
#endif
default:
return "Unknown Error";
}
return "Unknown Error";
return "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits.

I like the old return "Unknown Error"; a little more than the new default: return ...

Can we also use Macro to reduce the duplicate of having every VK_XXX written twice (one in case, one in return)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Unknown Error" is returned in the default case. That line of code is unreachable.

}

} // namespace vulkan