-
Notifications
You must be signed in to change notification settings - Fork 1k
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
don't panic if naga parsing of shader source fails #5034
don't panic if naga parsing of shader source fails #5034
Conversation
67503e7
to
7148796
Compare
7148796
to
0061d54
Compare
@waynr could you rebase the PR on latest trunk? so the new CI jobs can run. |
Ah, nvm, they didn't run because the clippy jobs are failing. |
0061d54
to
73d6fae
Compare
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.
This PR looks good to me, it's consistent with how we deal with WGSL shaders as well.
@nical do you want to take another look? |
e31179a
to
4d53a97
Compare
7159d78
to
f8bc24b
Compare
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
This should be ready to go. Pinging @nical & @cwfitzgerald for pending reviews. |
Thanks for working through this with me! |
Connections
#5019
fixes #2545
Description
In my application shaders are meant to be hot-reloaded on filesystem changes.
If there is a syntax issue with the newly-updated shader source
naga
parsingof the file can fail. In current trunk, the
Result
returned bynaga
parsingis simply unwrapped.
This PR removes the
naga
parse unwrap and instead bubbles theResult
upthrough the call stack so to be handled by the calling code.
I am opening this PR prior to updating the changelog and getting
cargo xtask test
to run just to start discussion (should have commits addressing thoseshortly after opening it).
Testing
I've updated the examples and test cases that were already calling
Device.create_shader_module
.Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.