third_party/spirv-cross/reference/opt/shaders-msl/asm/comp/variable-pointers-store-forwarding.asm.comp
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | struct foo |
| 7 | { |
| 8 | int a; |
| 9 | }; |
| 10 | |
| 11 | struct bar |
| 12 | { |
| 13 | int b; |
| 14 | }; |
| 15 | |
| 16 | kernel void main0(device foo& x [[buffer(0)]], device bar& y [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 17 | { |
| 18 | device int* _47 = (gl_GlobalInvocationID.x != 0u) ? &x.a : &y.b; |
| 19 | device int* _40 = _47; |
| 20 | device int* _33 = _47; |
| 21 | int _37 = x.a; |
| 22 | *_47 = 0; |
| 23 | y.b = _37 + _37; |
| 24 | } |
| 25 |