#version 450 // iter3 fullscreen triangle vertex shader. // Emits 3 vertices from gl_VertexIndex that cover NDC -1..1 with one big triangle. // idx=0: NDC (-1,-1) — top-left in Vulkan // idx=1: NDC ( 3,-1) — far-right (off-screen) // idx=2: NDC (-1, 3) — far-bottom (off-screen) // The visible portion of the triangle covers the full viewport. void main() { vec2 pos = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); gl_Position = vec4(pos * 2.0 - 1.0, 0.0, 1.0); }