#version 450
layout(push_constant) uniform GuiRectInfo {
    mat4 rectMatrix;
    mat4 texMatrix;
    vec4 color;
} uRectInfo;

layout(location = 0) out vec2 outTexCoords;
layout(location = 1) out vec4 outColor;

vec2 positions[6] = vec2[](
    vec2(0.0, 0.0),
    vec2(1.0, 0.0),
    vec2(0.0, 1.0),
    vec2(1.0, 0.0),
    vec2(1.0, 1.0),
    vec2(0.0, 1.0)
);

void main() {
    outTexCoords = (uRectInfo.texMatrix * vec4(positions[gl_VertexIndex], 0.0, 1.0)).xy;
    outColor = uRectInfo.color;
    gl_Position = uRectInfo.rectMatrix * vec4(positions[gl_VertexIndex], 0.0, 1.0);
}