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 colorWhite; 9}; 10struct Inputs { 11}; 12struct Outputs { 13 half4 sk_FragColor [[color(0)]]; 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 half4 color = half4(0.0h); 19 if (_uniforms.colorWhite.x == 1.0h) color.y = 1.0h; 20 if (_uniforms.colorWhite.x == 2.0h) ; else color.w = 1.0h; 21 while (_uniforms.colorWhite.x == 2.0h) ; 22 do ; while (_uniforms.colorWhite.x == 2.0h); 23 _out.sk_FragColor = color; 24 return _out; 25} 26