1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 half4 colorGreen; 6}; 7struct Inputs { 8}; 9struct Outputs { 10 half4 sk_FragColor [[color(0)]]; 11}; 12fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 13 Outputs _out; 14 (void)_out; 15 float _0_x = 1.0; 16 _0_x = abs(_0_x); 17 _0_x = abs(_0_x - 2.0); 18 _0_x = (_0_x * 2.0); 19 _0_x = sign(_0_x); 20 float2 _1_x = float2(1.0, 2.0); 21 _1_x = float2(length(_1_x)); 22 _1_x = float2(distance(_1_x, float2(3.0, 4.0))); 23 _1_x = float2(dot(_1_x, float2(3.0, 4.0))); 24 _1_x = normalize(_1_x); 25 _out.sk_FragColor = _uniforms.colorGreen; 26 return _out; 27} 28