[naga] change i32 arithmetic operations to use wrapping_
instead of checked_
#6835
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.
Connections
Addresses #6023
Description
For arithmetic operations between two variables of type
i32
, if an overflow occurs, it is meant to wrap instead of throw an error according to the WGSL spec ("Expressions on concrete integer types that overflow produce a result that is modulo 2bitwidth")Testing
Compiled the original program detailed in #6023 (and variations for other arithemtic operations) that threw the overflow error (now overflow error free)
Checklist
cargo fmt
.taplo format
.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.