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 float unknownInput; 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 if (_uniforms.unknownInput > 5.0) { 19 _out.sk_FragColor = half4(0.75h); 20 } else { 21 discard_fragment(); 22 } 23 int i = 0; 24 while (i < 10) { 25 _out.sk_FragColor *= 0.5h; 26 i++; 27 } 28 do { 29 _out.sk_FragColor += 0.25h; 30 } while (_out.sk_FragColor.x < 0.75h); 31 for (int i = 0;i < 10; i++) { 32 if (i % 2 == 1) break; else if (i > 100) return _out; else continue; 33 } 34 return _out; 35} 36