1#include <metal_stdlib> 2#include <simd/simd.h> 3 4using namespace metal; 5 6struct UBO 7{ 8 float4x4 mvp; 9 float2 targSize; 10 char _m2_pad[8]; 11 packed_float3 color; 12 float opacity; 13}; 14 15struct main0_out 16{ 17 float3 vNormal [[user(locn0)]]; 18 float3 vColor [[user(locn1)]]; 19 float2 vSize [[user(locn2)]]; 20 float4 gl_Position [[position]]; 21}; 22 23struct main0_in 24{ 25 float4 aVertex [[attribute(0)]]; 26 float3 aNormal [[attribute(1)]]; 27}; 28 29vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) 30{ 31 main0_out out = {}; 32 out.gl_Position = _18.mvp * in.aVertex; 33 out.vNormal = in.aNormal; 34 out.vColor = float3(_18.color) * _18.opacity; 35 out.vSize = _18.targSize * _18.opacity; 36 return out; 37} 38 39