2021-02-04 19:50:03 +00:00
|
|
|
struct Uniforms {
|
|
|
|
float4 colorGreen;
|
|
|
|
float4 colorRed;
|
|
|
|
float4 colorWhite;
|
|
|
|
};
|
2020-09-28 16:28:16 +00:00
|
|
|
struct Inputs {
|
|
|
|
};
|
|
|
|
struct Outputs {
|
|
|
|
float4 sk_FragColor [[color(0)]];
|
|
|
|
};
|
2021-02-04 19:50:03 +00:00
|
|
|
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
2021-01-19 18:07:55 +00:00
|
|
|
Outputs _out;
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_out;
|
2021-03-08 18:29:15 +00:00
|
|
|
float4 result;
|
2021-02-04 19:50:03 +00:00
|
|
|
float h;
|
2021-03-15 22:08:38 +00:00
|
|
|
h = _uniforms.colorWhite.x;
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
float2 h2;
|
2021-03-15 22:08:38 +00:00
|
|
|
h2 = float2(_uniforms.colorWhite.y);
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float3 h3;
|
2021-03-15 22:08:38 +00:00
|
|
|
h3 = float3(_uniforms.colorWhite.z);
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float4 h4;
|
2021-03-15 22:08:38 +00:00
|
|
|
h4 = float4(_uniforms.colorWhite.w);
|
|
|
|
false;
|
|
|
|
h3.y = _uniforms.colorWhite.x;
|
|
|
|
false;
|
|
|
|
h3.xz = float2(_uniforms.colorWhite.y);
|
|
|
|
false;
|
|
|
|
h4.zwxy = float4(_uniforms.colorWhite.w);
|
|
|
|
false;
|
2020-12-04 20:36:49 +00:00
|
|
|
float2x2 h2x2;
|
2021-03-15 22:08:38 +00:00
|
|
|
h2x2 = float2x2(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float3x3 h3x3;
|
2021-03-15 22:08:38 +00:00
|
|
|
h3x3 = float3x3(_uniforms.colorWhite.y);
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float4x4 h4x4;
|
2021-03-15 22:08:38 +00:00
|
|
|
h4x4 = float4x4(_uniforms.colorWhite.z);
|
|
|
|
false;
|
|
|
|
h3x3[1] = float3(_uniforms.colorWhite.z);
|
|
|
|
false;
|
|
|
|
h4x4[3].w = _uniforms.colorWhite.x;
|
|
|
|
false;
|
|
|
|
h2x2[0].x = _uniforms.colorWhite.x;
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
int i;
|
2021-03-15 22:08:38 +00:00
|
|
|
i = int(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2020-12-04 20:36:49 +00:00
|
|
|
int2 i2;
|
2021-03-15 22:08:38 +00:00
|
|
|
i2 = int2(int(_uniforms.colorWhite.y));
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
int3 i3;
|
2021-03-15 22:08:38 +00:00
|
|
|
i3 = int3(int(_uniforms.colorWhite.z));
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
int4 i4;
|
2021-03-15 22:08:38 +00:00
|
|
|
i4 = int4(int(_uniforms.colorWhite.w));
|
|
|
|
false;
|
|
|
|
i4.xyz = int3(int(_uniforms.colorWhite.z));
|
|
|
|
false;
|
|
|
|
i2.y = int(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
float f;
|
2021-03-15 22:08:38 +00:00
|
|
|
f = _uniforms.colorWhite.x;
|
|
|
|
false;
|
2020-12-04 20:36:49 +00:00
|
|
|
float2 f2;
|
2021-03-15 22:08:38 +00:00
|
|
|
f2 = float2(_uniforms.colorWhite.y);
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float3 f3;
|
2021-03-15 22:08:38 +00:00
|
|
|
f3 = float3(_uniforms.colorWhite.z);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
float4 f4;
|
2021-03-15 22:08:38 +00:00
|
|
|
f4 = float4(_uniforms.colorWhite.w);
|
|
|
|
false;
|
|
|
|
f3.xy = float2(_uniforms.colorWhite.y);
|
|
|
|
false;
|
|
|
|
f2.x = _uniforms.colorWhite.x;
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
float2x2 f2x2;
|
2021-03-15 22:08:38 +00:00
|
|
|
f2x2 = float2x2(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
float3x3 f3x3;
|
2021-03-15 22:08:38 +00:00
|
|
|
f3x3 = float3x3(_uniforms.colorWhite.y);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
float4x4 f4x4;
|
2021-03-15 22:08:38 +00:00
|
|
|
f4x4 = float4x4(_uniforms.colorWhite.z);
|
|
|
|
false;
|
|
|
|
f2x2[0].x = _uniforms.colorWhite.x;
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
bool b;
|
2021-03-15 22:08:38 +00:00
|
|
|
b = bool(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
bool2 b2;
|
2021-03-15 22:08:38 +00:00
|
|
|
b2 = bool2(bool(_uniforms.colorWhite.y));
|
|
|
|
false;
|
2020-12-04 20:36:49 +00:00
|
|
|
bool3 b3;
|
2021-03-15 22:08:38 +00:00
|
|
|
b3 = bool3(bool(_uniforms.colorWhite.z));
|
|
|
|
false;
|
2020-09-28 16:28:16 +00:00
|
|
|
bool4 b4;
|
2021-03-15 22:08:38 +00:00
|
|
|
b4 = bool4(bool(_uniforms.colorWhite.w));
|
|
|
|
false;
|
|
|
|
b4.xw = bool2(bool(_uniforms.colorWhite.y));
|
|
|
|
false;
|
|
|
|
b3.z = bool(_uniforms.colorWhite.x);
|
|
|
|
false;
|
2021-02-04 19:50:03 +00:00
|
|
|
bool ok = true;
|
2021-03-08 18:29:15 +00:00
|
|
|
ok = ok && 1.0 == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x;
|
2021-02-04 19:50:03 +00:00
|
|
|
ok = ok && 1.0 == (((((f * f2.x) * f3.x) * f4.x) * f2x2[0].x) * f3x3[0].x) * f4x4[0].x;
|
|
|
|
ok = ok && 1 == ((i * i2.x) * i3.x) * i4.x;
|
|
|
|
ok = ok && (((b && b2.x) && b3.x) && b4.x);
|
|
|
|
_out.sk_FragColor = ok ? _uniforms.colorGreen : _uniforms.colorRed;
|
2021-01-19 18:07:55 +00:00
|
|
|
return _out;
|
2020-09-28 16:28:16 +00:00
|
|
|
}
|