struct VsOut {
@builtin(position) position: vec4<f32>,
@location(0) color: vec4<f32>,
};
@vertex
fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VsOut {
var positions = array<vec2<f32>, 3>(
vec2<f32>(-1.0, -1.0),
vec2<f32>(3.0, -1.0),
vec2<f32>(-1.0, 3.0),
);
var out: VsOut;
out.position = vec4<f32>(positions[vertex_index], 0.0, 1.0);
out.color = vec4<f32>(0.82, 0.58, 0.28, 1.0);
return out;
}