From 982f33ff7ce6d0a1477b889e424a85582f17612c Mon Sep 17 00:00:00 2001 From: Arkitu <85173315+Arkitu@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:21:17 +0200 Subject: [PATCH] save --- src/shader.wgsl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/shader.wgsl diff --git a/src/shader.wgsl b/src/shader.wgsl new file mode 100644 index 0000000..baf7775 --- /dev/null +++ b/src/shader.wgsl @@ -0,0 +1,16 @@ +// Vertex shader + +struct VertexOutput { + @builtin(position) clip_position: vec4, +}; + +@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(x, y, 0.0, 1.0); + return out; +} \ No newline at end of file