1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 float zoom; 6}; 7struct Inputs { 8}; 9struct Outputs { 10 float4 sk_Position [[position]]; 11 float sk_PointSize [[point_size]]; 12}; 13 14vertex Outputs vertexMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], uint sk_VertexID [[vertex_id]], uint sk_InstanceID [[instance_id]]) { 15 Outputs _out; 16 (void)_out; 17 _out.sk_Position = float4(1.0); 18 if (_uniforms.zoom == 1.0) return (_out.sk_Position.y = -_out.sk_Position.y, _out); 19 _out.sk_Position *= _uniforms.zoom; 20 return (_out.sk_Position.y = -_out.sk_Position.y, _out); 21} 22