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

using namespace metal;

struct Globals
{
    float4x4 uVP;
    packed_float3 uOffset;
    float uLayer;
};

struct main0_out
{
    float4 FragColor [[color(0)]];
};

struct main0_in
{
    float2 vUV [[user(locn0)]];
};

fragment main0_out main0(main0_in in [[stage_in]], constant Globals& _23 [[buffer(0)]], texture2d_array<float> uAtlas [[texture(0)]], sampler uAtlasSmplr [[sampler(0)]])
{
    main0_out out = {};
    float3 _31 = float3(in.vUV, _23.uLayer);
    float4 t = uAtlas.sample(uAtlasSmplr, _31.xy, uint(rint(_31.z)));
    if (t.w < 0.039999999105930328369140625)
    {
        discard_fragment();
    }
    out.FragColor = float4(0.039999999105930328369140625, 0.02999999932944774627685546875, 0.02999999932944774627685546875, t.w);
    return out;
}

