1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Inputs { 5}; 6struct Outputs { 7 half4 sk_FragColor [[color(0)]]; 8}; 9 10half4 half4_from_half2x2(half2x2 x) { 11 return half4(x[0].xy, x[1].xy); 12} 13fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 14 Outputs _out; 15 (void)_out; 16 half2x2 x = half2x2(half2(0.0h, 1.0h), half2(2.0h, 3.0h)); 17 float2 y = float2(half4_from_half2x2(x).xy); 18 _out.sk_FragColor = half4(y.xyxy); 19 return _out; 20} 21