| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct main0_out |
| 7 |
{ |
| 8 |
float4 FragColor [[color(0)]]; |
| 9 |
}; |
| 10 |
|
| 11 |
struct main0_in |
| 12 |
{ |
| 13 |
float4 v0 [[user(locn0)]]; |
| 14 |
}; |
| 15 |
|
| 16 |
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uImage [[texture(0)]], sampler uImageSmplr [[sampler(0)]]) |
| 17 |
{ |
| 18 |
main0_out out = {}; |
| 19 |
float phi; |
| 20 |
float4 _36; |
| 21 |
int _51; |
| 22 |
_51 = 0; |
| 23 |
phi = 1.0; |
| 24 |
_36 = float4(1.0, 2.0, 1.0, 2.0); |
| 25 |
for (;;) |
| 26 |
{ |
| 27 |
out.FragColor = _36; |
| 28 |
if (_51 < 4) |
| 29 |
{ |
| 30 |
if (in.v0[_51] > 0.0) |
| 31 |
{ |
| 32 |
float2 _48 = float2(phi); |
| 33 |
_51++; |
| 34 |
phi += 2.0; |
| 35 |
_36 = uImage.sample(uImageSmplr, _48, level(0.0)); |
| 36 |
continue; |
| 37 |
} |
| 38 |
else |
| 39 |
{ |
| 40 |
break; |
| 41 |
} |
| 42 |
} |
| 43 |
else |
| 44 |
{ |
| 45 |
break; |
| 46 |
} |
| 47 |
} |
| 48 |
return out; |
| 49 |
} |
| 50 |
|