• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
4struct Uniforms {
5    half4 colorRed;
6    half4 colorGreen;
7    half4 colorWhite;
8    half4 colorBlack;
9};
10struct Inputs {
11};
12struct Outputs {
13    half4 sk_FragColor [[color(0)]];
14};
15void setToColorBlack_vh4(Uniforms _uniforms, thread half4& x);
16void _skOutParamHelper0_setToColorBlack_vh4(Uniforms _uniforms, thread half4& d) {
17    half4 _var0;
18    setToColorBlack_vh4(_uniforms, _var0);
19    d = _var0;
20}
21void setToColorBlack_vh4(Uniforms _uniforms, thread half4& x) {
22    x = _uniforms.colorBlack;
23}
24fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
25    Outputs _out;
26    (void)_out;
27    half4 a;
28    half4 b;
29    half4 c;
30    half4 d;
31    (b = _uniforms.colorRed , c = _uniforms.colorGreen);
32    a = (    _skOutParamHelper0_setToColorBlack_vh4(_uniforms, d) , _uniforms.colorWhite);
33    a *= a;
34    b *= b;
35    c *= c;
36    d *= d;
37    _out.sk_FragColor = ((all(a == _uniforms.colorWhite) && all(b == _uniforms.colorRed)) && all(c == _uniforms.colorGreen)) && all(d == _uniforms.colorBlack) ? _uniforms.colorGreen : _uniforms.colorRed;
38    return _out;
39}
40