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