SPIRV-Cross/reference/opt/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp

26 lines
443 B
Plaintext
Raw Normal View History

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct foo
{
int a;
};
struct bar
{
int b;
};
kernel void main0(device foo& x [[buffer(0)]], device bar& y [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
2019-04-03 19:37:38 +00:00
device int* _46 = (gl_GlobalInvocationID.x != 0u) ? &x.a : &y.b;
device int* _40 = _46;
device int* _33 = _46;
int _37 = x.a;
*_46 = 0;
y.b = _37 + _37;
}