#version 450 // Fullscreen triangle. The scene image is drawn as a single textured quad; the // push constant carries the destination rectangle (in window-normalized // coordinates, y down), so the map is letterboxed rather than stretched. layout(push_constant) uniform Push { vec4 rect; // xy = top-left (0..1), zw = size (0..1) } pc; layout(location = 0) out vec2 out_uv; void main() { // Vulkan clip space has +Y pointing DOWN, so p already runs top->bottom and // matches the image's top-left origin; do NOT flip it (OpenGL would). vec2 p = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); out_uv = (p - pc.rect.xy) / pc.rect.zw; gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0); }