Add coherent and volatile memory decorations for storage buffers.#9168
Merged
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom Mar 11, 2026
Merged
Add coherent and volatile memory decorations for storage buffers.#9168cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
Conversation
cwfitzgerald
approved these changes
Mar 10, 2026
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
This is great stuff, thank you for all the testing!
My one question is about metal - do you have a cite for all buffers being coherent already? My impression is that you'd need to make atomics use memory_order_seq_cst on those buffers to get full coherence.
Collaborator
Author
|
So it turns out I misread and got confused. Looking at MSL 3.2 coherent qualifier for buffers: Metal Shading Language Specification v4, section on address space qualifiers https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf shows that there actually is a decorator. Looking at the SPIRV-Cross implementation backs this up KhronosGroup/SPIRV-Cross#2473 showing they use |
9897728 to
03d7d94
Compare
03d7d94 to
f520aa3
Compare
cwfitzgerald
approved these changes
Mar 11, 2026
mockersf
pushed a commit
to bevyengine/naga_oil
that referenced
this pull request
Mar 19, 2026
wgpu 29 is close to releasing, so this is a preview of the naga-29 changes for naga-oil. Changes are currently relative to: updating from [this commit](gfx-rs/wgpu@0ab6edd) to [the two fixes below](gfx-rs/wgpu@e80dc8d) causes two test failures ``` test compose::test::test::test_atomics ... FAILED test compose::test::test::use_shared_global ... FAILED ``` - [coherent and volatile memory decorations](gfx-rs/wgpu#9168) - [InstanceDescriptor::default no longer exists](gfx-rs/wgpu#8782)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
#4444 (related)
Description
Adds support for coherent and volatile memory decorations where supported, via custom attributes on wgsl
@coherentand@volatile.Testing
Naga snapshots and validation tests
Squash or Rebase?
Squash
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.