1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Inputs { 5}; 6struct Outputs { 7 half4 sk_FragColor [[color(0)]]; 8}; 9fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 10 Outputs _out; 11 (void)_out; 12 half4 x = half4(1.0h, 1.0h, 1.0h, 1.0h); 13 while (x.w == 1.0h) { 14 x.x = x.x - 0.25h; 15 if (x.x <= 0.0h) break; 16 } 17 while (x.z > 0.0h) { 18 x.z = x.z - 0.25h; 19 if (x.w == 1.0h) continue; 20 x.y = 0.0h; 21 } 22 _out.sk_FragColor = x; 23 return _out; 24} 25