-
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
feature: [spv-front] Support for OpAtomicCompareExchange, fixes #6296 #6590
feature: [spv-front] Support for OpAtomicCompareExchange, fixes #6296 #6590
Conversation
bc2c9ab
to
5d88eda
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.
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.
The changes to type_gen.rs
are not the way we should handle this. That file should remain unchanged by this PR.
Instead, BlockContext
should borrow a shared reference to Module::special_types
in addition to all the other bits and pieces it borrows, and then it should simply look up the appropriate crate::PredeclaredType::AtomicCompareExchangeWeakResult
key in SpecialTypes::predeclared_types
. It knows it will find the entry, because parse
put them both there.
@schell Just a heads up, I pushed a tiny cleanup commit to this branch. |
The way this PR causes the atomic result types to be included in all modules built from SPIR-V source is not great. But it's not straightforward to address unless we fix #6679. |
fe3c399
to
704540b
Compare
This PR cannot be merged, in its current form, until #6682 is merged. |
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.
If I understand correctly, this is the final phase of your work on SPIR-V atomic input. If that's the case, then it's time to remove the tests in front/spv/mod.rs
, and turn atomic_compare_exchange.spv
into an ordinary snapshot test.
Cleaning up the tests is still a part of my intended work. My grant project goes to the end of the year (and I've re-applied for 2025 as well). |
Since I pushed a fix for some of my comments, for clarity I want to re-post the remaining items as a new review.
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.
It's okay to address the tests in a subsequent PR. For now, here are the only remaining items to be addressed. Pretty minor, this looks good otherwise.
Your last two comments have been addressed @jimblandy, I think we're g2g 👍 . |
589ab65
to
51af04a
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.
Looks great!
Note, this is still blocked on #6682. |
Add support for parsing and executing OpAtomicCompareExchange in the SPIR-V frontend. This concludes the work to support atomics in the SPIR-V frontend, excluding test clean-up. Fixes gfx-rs#6296. Fixes gfx-rs#6590. Connections: - [naga spv-in] Support for OpAtomicCompareExchange gfx-rs#6296 - [spv-in] Atomics support gfx-rs#4489
51af04a
to
d63c660
Compare
Add support for parsing and executing OpAtomicCompareExchange in the SPIR-V frontend. This concludes the work to support atomics in the SPIR-V frontend, excluding test clean-up. Fixes gfx-rs#6296. Fixes gfx-rs#6590. Connections: - [naga spv-in] Support for OpAtomicCompareExchange gfx-rs#6296 - [spv-in] Atomics support gfx-rs#4489 Co-authored-by: Jim Blandy <[email protected]>
d63c660
to
ec61a8d
Compare
Thank you @jimblandy ! 🙇 |
Connections
Description
Adds support for parsing and executing OpAtomicCompareExchange in the SPIR-V frontend.
This concludes the work to support atomics in the SPIR-V frontend, excluding test clean-up.
Testing
Checklist
BlockContext
hold a&mut Module
. #6682.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.