-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[naga hlsl-out, glsl-out] Support atomicCompareExchangeWeak #7658
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
[naga hlsl-out, glsl-out] Support atomicCompareExchangeWeak #7658
Conversation
I don't see DXC doing anything with the |
Thanks for addressing the comments, PR looks good - let's land it! |
Connections
Fixes #7578
Fixes #4364
Description
Adds support for atomicCompareExchangeWeak translation to hlsl and glsl.
Note this does not implement the [allow_uav_condition] loop attribute mentioned here and here.
Not sure the best way to check if the loop termination is based off a UAV read.
Maybe can later borrow logic from the uniformity analyzer?
Dawn doesn't seem to do this either, though maybe it should?
There is a test with a while loop that depends on .exchanged which seems to pass hlsl validation.
Testing
Added / enabled some basic atomicCompareExchangeWeak tests to Naga.
My personal project using atomicCompareExchangeWeak runs fine now on Windows/Nvidia/DX12.
GL backend is untested outside the Naga tests / validation.
Squash or Rebase?
Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.