wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Add 64 bit atomics

Open atlv24 opened this issue 11 months ago • 0 comments

Connections Part of an incoming series of PRs needed by #5123 Others in this series: #5155 #5154 Addresses #4424 Depends on #5498 and #5497 Ultimately for bevy meshlets pipeline https://github.com/bevyengine/bevy/pull/10164

Description Shaders currently do not support 64 bit integer atomics. Add support for these gated by a feature flag when the capability is present.

Metal 64bit atomics are quite different from VK/DX style atomics, they do not have a return/output value of any kind and are only available in min/max variants. To accommodate this, a separate feature was added for min/max 64 bit atomics, and AtomicFunctionNoReturn was created in the naga IR to represent these return-less atomics.

DirectX ShaderModel version detection was also implemented, as SM 6.0 was insufficient for this feature.

Testing A couple snapshot tests have been added to test int64 atomic operations.

Checklist

  • [x] Run cargo fmt.
  • [x] Run cargo clippy. If applicable, add:
    • [ ] --target wasm32-unknown-unknown
    • [ ] --target wasm32-unknown-emscripten
  • [x] Run cargo xtask test to run tests.
  • [x] Add change to CHANGELOG.md. See simple instructions inside file.

atlv24 avatar Mar 13 '24 07:03 atlv24