-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single type for all validation errors #2194
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marc0246
reviewed
May 4, 2023
Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
Mucho gracias. |
hakolao
pushed a commit
to hakolao/vulkano
that referenced
this pull request
Feb 20, 2024
* Single type for all validation errors * Documentation * Small improvement * Rename VulkanError to RuntimeError * Simplify the error type by using an intermediate struct * Update vulkano/src/lib.rs Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com> * Update vulkano/src/lib.rs Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com> * Update vulkano/src/lib.rs Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com> * Better solution * Revert to original state --------- Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
hakolao
pushed a commit
to hakolao/vulkano
that referenced
this pull request
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog:
After some Discord discussion earlier today, this PR proposes a new way to report validation errors to the user. I've replaced the old error type in compute pipeline creation, as an example to show how it looks in practice. If accepted, this change would be made across the board, but we can do it piecemeal, it doesn't have to be all at once.
The enums that Vulkano currently uses to report errors have many problems:
unwrap
an error, which most people will do, then you only get the debug print, which is far less helpful than the display print.Display
implementation to add a friendly message for the user. And again, you have to think of names for all of these variants.Several years ago, I made a proposal to replace all validation errors in Vulkano with panics: #1546. This was rejected, but it seemed that people were on board with simplifying the error types if Vulkan kept the standard
Result
+Error
error reporting. This implements that now.