SPIRV-Cross/reference/opt/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp
dan sinclair 8bf916f575 Roll dependencies
This CL updates the GLSLang, SPIRV-Tools and SPIRV-Headers dependencies.
2020-05-20 10:27:51 -04:00

26 lines
443 B
Plaintext

#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]])
{
device int* _47 = (gl_GlobalInvocationID.x != 0u) ? &x.a : &y.b;
device int* _40 = _47;
device int* _33 = _47;
int _37 = x.a;
*_47 = 0;
y.b = _37 + _37;
}