1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 half4 colorGreen; 6 half4 colorRed; 7 half4 colorBlack; 8 half4 colorWhite; 9 half4 testInputs; 10}; 11struct Inputs { 12}; 13struct Outputs { 14 half4 sk_FragColor [[color(0)]]; 15}; 16fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 17 Outputs _out; 18 (void)_out; 19 bool4 FTFT = bool4(_uniforms.colorGreen); 20 bool4 TFTF = FTFT.wzyx; 21 _out.sk_FragColor = ((((((select(_uniforms.colorBlack.x, _uniforms.colorWhite.x, FTFT.x) == _uniforms.colorBlack.x && all(select(_uniforms.colorBlack.xy, _uniforms.colorWhite.xy, FTFT.xy) == half2(_uniforms.colorBlack.x, 1.0h))) && all(select(_uniforms.colorBlack.xyz, _uniforms.colorWhite.xyz, FTFT.xyz) == half3(_uniforms.colorBlack.x, 1.0h, _uniforms.colorBlack.z))) && all(select(_uniforms.colorBlack, _uniforms.colorWhite, FTFT) == half4(_uniforms.colorBlack.x, 1.0h, _uniforms.colorBlack.z, 1.0h))) && select(_uniforms.colorWhite.x, _uniforms.testInputs.x, TFTF.x) == _uniforms.testInputs.x) && all(select(_uniforms.colorWhite.xy, _uniforms.testInputs.xy, TFTF.xy) == half2(_uniforms.testInputs.x, 1.0h))) && all(select(_uniforms.colorWhite.xyz, _uniforms.testInputs.xyz, TFTF.xyz) == half3(_uniforms.testInputs.x, 1.0h, _uniforms.testInputs.z))) && all(select(_uniforms.colorWhite, _uniforms.testInputs, TFTF) == half4(_uniforms.testInputs.x, 1.0h, _uniforms.testInputs.z, 1.0h)) ? _uniforms.colorGreen : _uniforms.colorRed; 22 return _out; 23} 24