struct VertexOutput { @builtin(position) Position : vec4, @location(0) fragUV : vec2 }; @vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOutput { var pos = array, 4>( vec2(-1., 1.), vec2(-1., -1.), vec2(1., 1.), vec2(1., -1.) ); var output : VertexOutput; output.Position = vec4(pos[VertexIndex], 0.0, 1.0); output.fragUV = vec2(output.Position.x + 1., output.Position.y + 1.) * 0.5; return output; }