2020-12-09 17:35:48 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct Inputs {
|
|
|
|
};
|
|
|
|
struct Outputs {
|
|
|
|
float4 sk_FragColor [[color(0)]];
|
|
|
|
};
|
|
|
|
struct Globals {
|
|
|
|
float2 glob;
|
|
|
|
};
|
2021-01-19 18:07:55 +00:00
|
|
|
float4 fn(thread Outputs& _out, thread Globals& _globals, float a, thread float2& b, thread float2& c, thread float3& d);
|
|
|
|
float4 _skOutParamHelper0_fn(thread Outputs& _out, thread Globals& _globals, float _var0, thread float3& b, thread float2& glob, thread float3x3& d) {
|
2020-12-09 17:35:48 +00:00
|
|
|
float2 _var1;
|
|
|
|
float2 _var2 = glob.yx;
|
|
|
|
float3 _var3 = d[1].zyx;
|
2021-01-19 18:07:55 +00:00
|
|
|
float4 _skResult = fn(_out, _globals, _var0, _var1, _var2, _var3);
|
2020-12-09 17:35:48 +00:00
|
|
|
b.yz = _var1;
|
|
|
|
glob.yx = _var2;
|
|
|
|
d[1].zyx = _var3;
|
|
|
|
return _skResult;
|
|
|
|
}
|
|
|
|
|
2021-01-19 18:07:55 +00:00
|
|
|
float4 fn(thread Outputs& _out, thread Globals& _globals, float a, thread float2& b, thread float2& c, thread float3& d) {
|
|
|
|
a = _out.sk_FragColor.x + a;
|
|
|
|
b = _out.sk_FragColor.yz - _globals.glob.y;
|
2020-12-09 17:35:48 +00:00
|
|
|
c *= a;
|
2021-01-19 18:07:55 +00:00
|
|
|
d = _out.sk_FragColor.www / d;
|
2020-12-09 17:35:48 +00:00
|
|
|
return float4(a, b.x, c.y, d.x);
|
|
|
|
}
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
2021-01-19 18:07:55 +00:00
|
|
|
Globals _globals{float2(1.0)};
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_globals;
|
2021-01-19 18:07:55 +00:00
|
|
|
Outputs _out;
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_out;
|
2020-12-09 17:35:48 +00:00
|
|
|
float3 b = float3(2.0);
|
|
|
|
float3x3 d = float3x3(4.0);
|
2021-03-04 15:19:48 +00:00
|
|
|
_out.sk_FragColor = _skOutParamHelper0_fn(_out, _globals, 1.0, b, _globals.glob, d);
|
2021-01-19 18:07:55 +00:00
|
|
|
return _out;
|
2020-12-09 17:35:48 +00:00
|
|
|
}
|