2019-01-08 21:16:17 +00:00
|
|
|
#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;
|
2019-01-08 21:16:17 +00:00
|
|
|
}
|
|
|
|
|