#version 450
#extension GL_EXT_nonuniform_qualifier : require

struct FlrInput
{
    uint vertexId;
};

struct FlrOutput
{
    vec4 pos;
    vec2 uv0;
};


// Vk3DVision (http://3dsurroundgaming.com/) - Stereo Injection
layout(set = 0, binding = 110, std140) uniform Vk3DParams
{
    vec4 stereo;
    vec4 custom_params;
} vk3d_params;

layout(set = 0, binding = 99, std430) buffer DebugBuffer
{
    uint debugBuffer[];
} _101;

layout(set = 2, binding = 0) uniform texture2D globalTextures[];
layout(set = 2, binding = 0) uniform textureCube globalCubeTextures[];
layout(set = 2, binding = 0) uniform texture3D global3DTextures[];
layout(set = 1, binding = 0) uniform sampler linearClampSampler;
layout(set = 1, binding = 1) uniform sampler linearRepeatSampler;
layout(set = 1, binding = 2) uniform sampler nearestClampSampler;
layout(set = 1, binding = 3) uniform sampler nearestRepeatSampler;
layout(set = 1, binding = 4) uniform sampler shadowSampler;

layout(location = 0) out vec2 outUV0;

void flrMain(FlrInput flrInput, inout FlrOutput flrOutput)
{
    flrOutput.pos = vec4((float(flrInput.vertexId / 2u) * 4.0) - 1.0, (float(flrInput.vertexId % 2u) * 4.0) - 1.0, 0.0, 1.0);
    flrOutput.uv0 = vec2(float(flrInput.vertexId / 2u) * 2.0, float(flrInput.vertexId % 2u) * 2.0);
}

void main()
{
    FlrInput flrInput;
    flrInput.vertexId = uint(gl_VertexIndex);
    FlrInput param = flrInput;
    FlrOutput param_1;
    flrMain(param, param_1);
    FlrOutput flrOutput = param_1;
    outUV0 = flrOutput.uv0;
    gl_Position = flrOutput.pos;
    //outUV0.x += vk3d_params.stereo.x*(gl_Position.w-vk3d_params.stereo.y);
}




