Ben Clayton | 8a96c78 | 2021-07-15 20:29:09 +0000 | [diff] [blame] | 1 | int atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { |
| 2 | int value = 0; |
| 3 | buffer.InterlockedOr(offset, 0, value); |
| 4 | return value; |
| 5 | } |
| 6 | |
| 7 | cbuffer cbuffer_constants : register(b0, space1) { |
| 8 | uint4 constants[1]; |
| 9 | }; |
| 10 | |
| 11 | RWByteAddressBuffer result : register(u1, space1); |
| 12 | |
| 13 | RWByteAddressBuffer s : register(u0, space0); |
| 14 | |
| 15 | int runTest() { |
| 16 | return atomicLoad_1(s, (4u * (0u + uint(constants[0].x)))); |
| 17 | } |
| 18 | |
| 19 | [numthreads(1, 1, 1)] |
| 20 | void main() { |
| 21 | result.Store(0u, asuint(uint(runTest()))); |
| 22 | return; |
| 23 | } |