diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-07-19 02:05:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-18 23:05:33 -0700 |
| commit | a00d603519d395d41b2f68c5874e8a708335a31a (patch) | |
| tree | 114e3da71d3d95034e944edb0ffd1510f192418d /tests/metal/atomic-texture-texture3d.slang | |
| parent | 59dd133f1c52fb0a7a388f4a8f42234f4556a28a (diff) | |
Metal: `Interlocked` (atomic) member function support for buffers (#4655)
* Metal: `Interlocked` (atomic) member function support for buffers
fixes: #4654
fixes: #4481
1. Add `Interlocked` (atomic) member function support for buffers to Metal
2. Fix `__getEquivalentStructuredBuffer` so it works with CPP/Metal targets
* add `CompareStore` support
* legalize RWByteAddressBuffer to fully replace StructuredBuffer
* destroy replaced byte-addr buffer
* cleanup as per review and add comment to explain why certain code exists
* fix flow of byte-address-buffer replacement
* toggle on option to translate byteAddrBuffer to StructuredBuffer
* cleanup unused buffers
* add treatGetEquivalentStructuredBufferAsGetThis flag to treat getEquivStructuredBuffer as a byteAddressBuffer
* comment to explain `treatGetEquivalentStructuredBufferAsGetThis`
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/metal/atomic-texture-texture3d.slang')
| -rw-r--r-- | tests/metal/atomic-texture-texture3d.slang | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/metal/atomic-texture-texture3d.slang b/tests/metal/atomic-texture-texture3d.slang index 5a97cc44f..755b941da 100644 --- a/tests/metal/atomic-texture-texture3d.slang +++ b/tests/metal/atomic-texture-texture3d.slang @@ -30,6 +30,7 @@ void test() // METAL: .atomic_fetch_xor // METAL: .atomic_exchange // METAL: .atomic_compare_exchange_weak +// METAL: .atomic_compare_exchange_weak // METAL: .atomic_fetch_add // METAL: .atomic_fetch_and @@ -45,6 +46,7 @@ void test() // METAL: .atomic_fetch_xor // METAL: .atomic_exchange // METAL: .atomic_compare_exchange_weak +// METAL: .atomic_compare_exchange_weak InterlockedAdd(intTexture3D[0], valInt); InterlockedAnd(intTexture3D[0], valInt); InterlockedMax(intTexture3D[0], valInt); @@ -59,6 +61,7 @@ void test() InterlockedXor(intTexture3D[0], valInt, originalValueInt); InterlockedExchange(intTexture3D[0], valInt, originalValueInt); InterlockedCompareExchange(intTexture3D[0], valInt, compareValueInt, originalValueInt); + InterlockedCompareStore(intTexture3D[0], valUInt, compareValueUInt); InterlockedAdd(uintTexture3D[0], valUInt); InterlockedAnd(uintTexture3D[0], valUInt); @@ -74,6 +77,7 @@ void test() InterlockedXor(uintTexture3D[0], valUInt, originalValueUInt); InterlockedExchange(uintTexture3D[0], valUInt, originalValueUInt); InterlockedCompareExchange(uintTexture3D[0], valUInt, compareValueUInt, originalValueUInt); + InterlockedCompareStore(uintTexture3D[0], valUInt, compareValueUInt); } |
