#version 450

#include "rounded_tex.common.glsl"

layout(location = 0) out vec2 tex_pos;
layout(location = 1) out vec2 geo_pos;

void main() {
	vec2 size = vec2(data.size_x, data.size_y);
	Vertex vertex = data.vertices.vertices[gl_InstanceIndex];
	gl_Position = vec4(vertex.pos[gl_VertexIndex], 0.0, 1.0);
	tex_pos = vertex.tex_pos[gl_VertexIndex];
	switch (gl_VertexIndex) {
		case 0: geo_pos = vec2(size.x, 0.0); break;
		case 1: geo_pos = vec2(0.0, 0.0); break;
		case 2: geo_pos = vec2(size.x, size.y); break;
		case 3: geo_pos = vec2(0.0, size.y); break;
	}
}
