var DATA: array, 6> = array, 6>( vec4( -1.0, 1.0, 0.0, 1.0 ), vec4( -1.0, -1.0, 0.0, 0.0 ), vec4( 1.0, -1.0, 1.0, 0.0 ), vec4( -1.0, 1.0, 0.0, 1.0 ), vec4( 1.0, -1.0, 1.0, 0.0 ), vec4( 1.0, 1.0, 1.0, 1.0 ) ); struct VertexOutput { @builtin(position) clip_position: vec4, @location(0) tex_coords: vec2, }; @vertex fn vertex( @builtin(vertex_index) in_vertex_index: u32, ) -> VertexOutput { var out: VertexOutput; out.clip_position = vec4(DATA[in_vertex_index].xy, 0.0, 1.0); out.tex_coords = DATA[in_vertex_index].zw; return out; } @group(0) @binding(0) var t_diffuse: texture_2d; @group(0) @binding(1) var s_diffuse: sampler; @fragment fn fragment(in: VertexOutput) -> @location(0) vec4 { return textureSample(t_diffuse, s_diffuse, in.tex_coords); }