| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct UBO |
| 7 |
{ |
| 8 |
float4 results[1024]; |
| 9 |
}; |
| 10 |
|
| 11 |
struct main0_out |
| 12 |
{ |
| 13 |
float4 FragColor [[color(0)]]; |
| 14 |
}; |
| 15 |
|
| 16 |
struct main0_in |
| 17 |
{ |
| 18 |
int vIn [[user(locn0)]]; |
| 19 |
int vIn2 [[user(locn1)]]; |
| 20 |
}; |
| 21 |
|
| 22 |
fragment main0_out main0(main0_in in [[stage_in]], device UBO& _34 [[buffer(0)]], texture2d<int> Buf [[texture(0)]], sampler BufSmplr [[sampler(0)]], float4 gl_FragCoord [[position]]) |
| 23 |
{ |
| 24 |
main0_out out = {}; |
| 25 |
int _40 = Buf.read(uint2(int2(gl_FragCoord.xy)), 0).x % 16; |
| 26 |
out.FragColor = (_34.results[_40] + _34.results[_40]) + _34.results[(in.vIn * in.vIn) + (in.vIn2 * in.vIn2)]; |
| 27 |
return out; |
| 28 |
} |
| 29 |
|