#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct Globals
{
    float4x4 uVP;
    packed_float3 uTint;
    float uHasView;
    float uGlowPass;
    float uTime;
};

struct main0_out
{
    float2 vUV [[user(locn0)]];
    float4 vClip [[user(locn1)]];
    float4 gl_Position [[position]];
};

struct main0_in
{
    float3 aPos [[attribute(0)]];
    float2 aUV [[attribute(1)]];
};

vertex main0_out main0(main0_in in [[stage_in]], constant Globals& _20 [[buffer(0)]])
{
    main0_out out = {};
    out.vUV = in.aUV;
    out.vClip = _20.uVP * float4(in.aPos, 1.0);
    out.gl_Position = out.vClip;
    out.gl_Position.z = (out.gl_Position.z + out.gl_Position.w) * 0.5;
    return out;
}

