1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 half4 colorGreen; 6 half4 colorRed; 7}; 8struct Inputs { 9}; 10struct Outputs { 11 half4 sk_FragColor [[color(0)]]; 12}; 13fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 14 Outputs _out; 15 (void)_out; 16 float f = float(_uniforms.colorGreen.y); 17 int i = int(_uniforms.colorGreen.y); 18 bool b = bool(_uniforms.colorGreen.y); 19 float f1 = f; 20 float f2 = float(i); 21 float f3 = float(b); 22 int i1 = int(f); 23 int i2 = i; 24 int i3 = int(b); 25 bool b1 = bool(f); 26 bool b2 = bool(i); 27 bool b3 = b; 28 _out.sk_FragColor = (((((((half(f1) + half(f2)) + half(f3)) + half(i1)) + half(i2)) + half(i3)) + half(b1)) + half(b2)) + half(b3) == 9.0h ? _uniforms.colorGreen : _uniforms.colorRed; 29 return _out; 30} 31