| 1 |
#pragma clang diagnostic ignored "-Wunused-variable" |
| 2 |
|
| 3 |
#include <metal_stdlib> |
| 4 |
#include <simd/simd.h> |
| 5 |
#include <metal_atomic> |
| 6 |
|
| 7 |
using namespace metal; |
| 8 |
|
| 9 |
struct SSBO |
| 10 |
{ |
| 11 |
uint a; |
| 12 |
uint b; |
| 13 |
}; |
| 14 |
|
| 15 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 16 |
|
| 17 |
kernel void main0(device SSBO& _5 [[buffer(0)]]) |
| 18 |
{ |
| 19 |
uint _20 = atomic_load_explicit((device atomic_uint*)&_5.b, memory_order_relaxed); |
| 20 |
uint c = _20; |
| 21 |
atomic_store_explicit((device atomic_uint*)&_5.a, c, memory_order_relaxed); |
| 22 |
} |
| 23 |
|