1#include <metal_stdlib> 2#include <simd/simd.h> 3#ifdef __clang__ 4#pragma clang diagnostic ignored "-Wall" 5#endif 6using namespace metal; 7struct Inputs { 8}; 9struct Outputs { 10 half4 sk_FragColor [[color(0)]]; 11}; 12fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 13 Outputs _out; 14 (void)_out; 15 float x = 0.0; 16 switch (0) { 17 case 0: 18 x = 0.0; 19 if (x < 1.0) { 20 _out.sk_FragColor = half4(half(x)); 21 break; 22 } 23 case 1: 24 x = 1.0; 25 } 26 return _out; 27} 28