-
Notifications
You must be signed in to change notification settings - Fork 962
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
Include naga parse error in the error chain #1760
Conversation
Wraps the Naga's `ParseError` with `NagaParseError` type, that uses the Naga's full error formatting for its `Display` impl, including shader source.
Looks a little something like this
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I'm really grateful for this change, but one issue I'm facing is that newlines are escaped in the result. An example:
Is this intentional or could we change something to fix this? I reckon it should be a minor change, but I don't know enough about Rust strings to know what that change should be. |
Interesting. This is definitely not what we see. Where does this wgpu/wgpu/src/backend/direct.rs Line 2156 in 0e65b93
|
Would that be where create_shader_module is called? (and in check_error here |
Right. It needs to be |
Then I get:
|
Could you try |
Then I can use |
Oh, I see now. In wgpu-rs, between the wgpu-core call and the user error report, there is also this piece happening - wgpu/wgpu/src/backend/direct.rs Lines 146 to 169 in 0e65b93
And that's not a part of wgpu-native atm. Would you mind filing an issue to wgpu-native to follow-up on this? |
Connections
Probably makes #1424 moot
Description
Wraps the Naga
ParseError
withNagaParseError
that shows the full Naga diagnostic in itsDisplay impl
and adding it to theCreateShaderModuleError::Parsing
variant, allows for the wgsl diagnostics to be visible in the displayed validation error.Testing
With modifying examples