Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This renames the internal
Error
type toVulkanError
(so that it no longer conflicts withstd::error::Error
) and auto-generates it from vk.xml. Thecheck_errors
function and theSuccess
enum are also removed. There is also a newimpl From<ash::vk::Result> for VulkanError
, which is tolerant to error codes it doesn't know about; it will wrap them in theUnnamed
variant, whereascheck_errors
would panic before.My intention for the future is to return
VulkanError
directly to the user. Currently, there areFrom<VulkanError>
implementations for every error type, which translate known errors for that function. But this adds a lot of duplication, especially for eachDisplay
implementation that has to repeat the same error messages for standard Vulkan errors.Moreover, these
From<VulkanError>
implementations currently panic if a Vulkan API function returns an error that is not expected for that function. Some Vulkan implementations will return errors that aren't in the spec, and Vulkano will therefore indiscriminately crash the user's program based on something they have no control over, which is not very helpful. So instead of trying to translate each known error and panicking on the remainder, returningVulkanError
directly would be more tolerant of unusual Vulkan implementations, letting the user deal with the unexpected behaviour instead.