1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 half4 testInputs; 6 half4 colorGreen; 7 half4 colorRed; 8}; 9struct Inputs { 10}; 11struct Outputs { 12 half4 sk_FragColor [[color(0)]]; 13}; 14fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 15 Outputs _out; 16 (void)_out; 17 half4 v = _uniforms.testInputs; 18 v = half4(v.x, 1.0h, 1.0h, 1.0h); 19 v = half4(v.xy, 1.0h, 1.0h); 20 v = half4(v.x, 1.0h, 1.0h, 1.0h); 21 v = half4(0.0h, v.y, 1.0h, 1.0h); 22 v = half4(v.xyz, 1.0h); 23 v = half4(v.xy, 1.0h, 1.0h); 24 v = half4(v.x, 0.0h, v.z, 1.0h); 25 v = half4(v.x, 1.0h, 0.0h, 1.0h); 26 v = half4(1.0h, v.yz, 1.0h); 27 v = half4(0.0h, v.y, 1.0h, 1.0h); 28 v = half4(1.0h, 1.0h, v.z, 1.0h); 29 v = half4(v.xyz, 1.0h); 30 v = half4(v.xy, 0.0h, v.w); 31 v = half4(v.xy, 1.0h, 0.0h); 32 v = half4(v.x, 1.0h, v.zw); 33 v = half4(v.x, 0.0h, v.z, 1.0h); 34 v = half4(v.x, 1.0h, 1.0h, v.w); 35 v = half4(v.x, 1.0h, 0.0h, 1.0h); 36 v = half4(1.0h, v.yzw); 37 v = half4(0.0h, v.yz, 1.0h); 38 v = half4(0.0h, v.y, 1.0h, v.w); 39 v = half4(1.0h, v.y, 1.0h, 1.0h); 40 v = half4(0.0h, 0.0h, v.zw); 41 v = half4(0.0h, 0.0h, v.z, 1.0h); 42 v = half4(0.0h, 1.0h, 1.0h, v.w); 43 _out.sk_FragColor = all(v == half4(0.0h, 1.0h, 1.0h, 1.0h)) ? _uniforms.colorGreen : _uniforms.colorRed; 44 return _out; 45} 46