2019-01-07 09:43:55 +00:00
|
|
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
|
|
|
|
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct Foo
|
|
|
|
{
|
2019-05-23 12:54:04 +00:00
|
|
|
float3 a;
|
2019-01-07 09:43:55 +00:00
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Foo_1
|
|
|
|
{
|
2019-05-23 12:54:04 +00:00
|
|
|
packed_float3 a;
|
2019-01-07 09:43:55 +00:00
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct buf
|
|
|
|
{
|
2019-10-24 10:22:30 +00:00
|
|
|
Foo_1 results[16];
|
2019-01-07 09:43:55 +00:00
|
|
|
float4 bar;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct main0_out
|
|
|
|
{
|
|
|
|
float4 _entryPointOutput [[color(0)]];
|
|
|
|
};
|
|
|
|
|
2019-08-14 15:09:39 +00:00
|
|
|
static inline __attribute__((always_inline))
|
|
|
|
float4 _main(thread const float4& pos, constant buf& v_11)
|
2019-01-07 09:43:55 +00:00
|
|
|
{
|
|
|
|
int _46 = int(pos.x) % 16;
|
2019-05-23 12:54:04 +00:00
|
|
|
Foo foo;
|
2019-01-17 09:06:23 +00:00
|
|
|
foo.a = float3(v_11.results[_46].a);
|
2019-01-07 09:43:55 +00:00
|
|
|
foo.b = v_11.results[_46].b;
|
|
|
|
return float4(dot(foo.a, v_11.bar.xyz), foo.b, 0.0, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
fragment main0_out main0(constant buf& v_11 [[buffer(0)]], float4 gl_FragCoord [[position]])
|
|
|
|
{
|
|
|
|
main0_out out = {};
|
|
|
|
float4 pos = gl_FragCoord;
|
|
|
|
float4 param = pos;
|
|
|
|
out._entryPointOutput = _main(param, v_11);
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|