-
Notifications
You must be signed in to change notification settings - Fork 331
Description
The original storage texture investigation (#513) mentioned that atomic operations were allowed on storage textures under DirectX and Vulkan. At the time Metal did not support them:
On D3D12, feature level 11_0 devices support atomic operations (UAV Atomic Exchange, UAV Atomic Signed Min/Max, UAV Atomic Unsigned Min/Max, UAV Atomic Add, UAV Atomic Bitwise Ops and UAV Atomic Cmp&Store/ Cmp&Exch) on R32_UINT and R32_SINT.
On Metal Shading Language (Chapter 6.13), atomic functions are only allowed on Metal atomic data, which does not include writable textures.
On Vulkan, the image atomic functions are supported on the formats with VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT. Vulkan SPEC (Table 65) requires VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT must be supported on VK_FORMAT_R32_UINT and VK_FORMAT_R32_SINT
However, that changed in Metal 3.1:
Metal 3.1 introduces new atomic texture member functions supported on 1D texture, 1D texture array, 2D texture, 2D texture array, 3D texture, and texture buffer for int, uint, ulong color types
Texture atomics form the basis for compute shader rasterization (e.g. Nanite) and likely other graphics techniques as well. With support by all three APIs, they now could be exposed as a WebGPU extension.
See also: #3838 (comment) in the storage texture tiers proposal.