1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Inputs { 5}; 6struct Outputs { 7 half4 sk_FragColor [[color(0)]]; 8}; 9struct Globals { 10 texture2d<half> tex; 11 sampler texSmplr; 12}; 13fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<half> tex[[texture(0)]], sampler texSmplr[[sampler(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 14 Globals _globals{tex, texSmplr}; 15 (void)_globals; 16 Outputs _out; 17 (void)_out; 18 float3 _skTemp0; 19 float4 a = float4(_globals.tex.sample(_globals.texSmplr, float2(0.0))); 20 float4 b = float4(_globals.tex.sample(_globals.texSmplr, (_skTemp0 = float3(0.0), _skTemp0.xy / _skTemp0.z))); 21 _out.sk_FragColor = half4(half2(a.xy), half2(b.zw)); 22 return _out; 23} 24