9b7140e2ba
Need some emulation on GLSL/HLSL, fix bug with atomic store on MSL.
24 lines
494 B
Plaintext
24 lines
494 B
Plaintext
#pragma clang diagnostic ignored "-Wunused-variable"
|
|
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
#include <metal_atomic>
|
|
|
|
using namespace metal;
|
|
|
|
struct SSBO
|
|
{
|
|
uint a;
|
|
uint b;
|
|
};
|
|
|
|
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
|
|
|
|
kernel void main0(device SSBO& _5 [[buffer(0)]])
|
|
{
|
|
uint _20 = atomic_load_explicit((device atomic_uint*)&_5.b, memory_order_relaxed);
|
|
uint c = _20;
|
|
atomic_store_explicit((device atomic_uint*)&_5.a, c, memory_order_relaxed);
|
|
}
|
|
|