summaryrefslogtreecommitdiffstats
path: root/examples/integration/src/shader
diff options
context:
space:
mode:
Diffstat (limited to 'examples/integration/src/shader')
-rw-r--r--examples/integration/src/shader/frag.wgsl4
-rw-r--r--examples/integration/src/shader/vert.wgsl6
2 files changed, 10 insertions, 0 deletions
diff --git a/examples/integration/src/shader/frag.wgsl b/examples/integration/src/shader/frag.wgsl
new file mode 100644
index 00000000..cf27bb56
--- /dev/null
+++ b/examples/integration/src/shader/frag.wgsl
@@ -0,0 +1,4 @@
+@fragment
+fn main() -> @location(0) vec4<f32> {
+ return vec4<f32>(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/examples/integration/src/shader/vert.wgsl b/examples/integration/src/shader/vert.wgsl
new file mode 100644
index 00000000..e353e6ba
--- /dev/null
+++ b/examples/integration/src/shader/vert.wgsl
@@ -0,0 +1,6 @@
+@vertex
+fn main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
+ let x = f32(1 - i32(in_vertex_index)) * 0.5;
+ let y = f32(1 - i32(in_vertex_index & 1u) * 2) * 0.5;
+ return vec4<f32>(x, y, 0.0, 1.0);
+}