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-buffer.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-buffer.slang')
| -rw-r--r-- | tests/metal/atomic-texture-buffer.slang | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/metal/atomic-texture-buffer.slang b/tests/metal/atomic-texture-buffer.slang index b1a5bcf25..3e4eda94b 100644 --- a/tests/metal/atomic-texture-buffer.slang +++ b/tests/metal/atomic-texture-buffer.slang @@ -44,6 +44,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 @@ -59,6 +60,7 @@ void test() // METAL: .atomic_fetch_xor // METAL: .atomic_exchange // METAL: .atomic_compare_exchange_weak +// METAL: .atomic_compare_exchange_weak InterlockedAdd(intBuffer[0], valInt); InterlockedAnd(intBuffer[0], valInt); InterlockedMax(intBuffer[0], valInt); @@ -73,6 +75,7 @@ void test() InterlockedXor(intBuffer[0], valInt, originalValueInt); InterlockedExchange(intBuffer[0], valInt, originalValueInt); InterlockedCompareExchange(intBuffer[0], valInt, compareValueInt, originalValueInt); + InterlockedCompareStore(intBuffer[0], valUInt, compareValueUInt); InterlockedAdd(uintBuffer[0], valUInt); InterlockedAnd(uintBuffer[0], valUInt); @@ -88,6 +91,7 @@ void test() InterlockedXor(uintBuffer[0], valUInt, originalValueUInt); InterlockedExchange(uintBuffer[0], valUInt, originalValueUInt); InterlockedCompareExchange(uintBuffer[0], valUInt, compareValueUInt, originalValueUInt); + InterlockedCompareStore(uintBuffer[0], valUInt, compareValueUInt); } [numthreads(1, 1, 1)] |
