This commit is contained in:
Arkitu 2024-08-18 19:21:17 +02:00
parent 9b432cdcdb
commit 982f33ff7c

16
src/shader.wgsl Normal file
View File

@ -0,0 +1,16 @@
// Vertex shader
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 = f32(1 - i32(in_vertex_index)) * 0.5;
let y = f32(i32(in_vertex_index & 1u) * 2 - 1) * 0.5;
out.clip_position = vec4<f32>(x, y, 0.0, 1.0);
return out;
}