• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
4struct Uniforms {
5    half4 testInputs;
6    half4 colorGreen;
7    half4 colorRed;
8};
9struct Inputs {
10};
11struct Outputs {
12    half4 sk_FragColor [[color(0)]];
13};
14fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
15    Outputs _out;
16    (void)_out;
17    half4 _0_v = _uniforms.testInputs;
18    half _1_x = _0_v.x;
19    half _2_y = _0_v.y;
20    half _3_z = _0_v.z;
21    half _4_w = _0_v.w;
22    half4 a = half4(_1_x, _2_y, _3_z, _4_w);
23    half _9_x = _uniforms.testInputs.x;
24    half _10_y = _uniforms.testInputs.y;
25    half _11_z = _uniforms.testInputs.z;
26    half _12_w = _uniforms.testInputs.w;
27    half4 b = half4(_9_x, _10_y, _11_z, _12_w);
28    half4 _13_v = half4(0.0h, 1.0h, 2.0h, 3.0h);
29    half _14_x = _13_v.x;
30    half _15_y = _13_v.y;
31    half _16_z = _13_v.z;
32    half _17_w = _13_v.w;
33    half4 c = half4(_14_x, _15_y, _16_z, _17_w);
34    _out.sk_FragColor = (all(a == half4(-1.25h, 0.0h, 0.75h, 2.25h)) && all(b == half4(-1.25h, 0.0h, 0.75h, 2.25h))) && all(c == half4(0.0h, 1.0h, 2.0h, 3.0h)) ? _uniforms.colorGreen : _uniforms.colorRed;
35    return _out;
36}
37