blob: 7d2c5cee92c8705a972891238b18e63e7c3de7c3 (
plain)
struct VertexOutput {
@builtin(position) clip_position: vec4<f32>
}
@vertex
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> VertexOutput {
var out: VertexOutput;
let x = (1.0 * f32(in_vertex_index % u32(2))) + -0.5;
let y = (1.0 * f32(in_vertex_index / u32(2))) + -0.5;
out.clip_position = vec4<f32>(x, y, 0.0, 1.0);
return out;
}
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
return vec4<f32>(1.0, 1.0, 1.0, 0.0);
}
|