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