summaryrefslogtreecommitdiff
path: root/cli/tests/webgpu_hellotriangle_shader.wgsl
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-05-06 16:48:45 +0200
committerGitHub <noreply@github.com>2021-05-06 16:48:45 +0200
commitf208e6a26f3c21c25dbfcfe29491a6f5660c999d (patch)
tree65dbbd45b2f36faab8ae585eb0d270356bcba33e /cli/tests/webgpu_hellotriangle_shader.wgsl
parentce76f8c3a97529c86d49c39c6d9a250f978b5430 (diff)
chore: update wgpu and realign to spec (#9760)
Diffstat (limited to 'cli/tests/webgpu_hellotriangle_shader.wgsl')
-rw-r--r--cli/tests/webgpu_hellotriangle_shader.wgsl21
1 files changed, 6 insertions, 15 deletions
diff --git a/cli/tests/webgpu_hellotriangle_shader.wgsl b/cli/tests/webgpu_hellotriangle_shader.wgsl
index 71934415b..b8b2b69fc 100644
--- a/cli/tests/webgpu_hellotriangle_shader.wgsl
+++ b/cli/tests/webgpu_hellotriangle_shader.wgsl
@@ -1,19 +1,10 @@
-[[builtin(vertex_index)]]
-var<in> in_vertex_index: u32;
-[[builtin(position)]]
-var<out> out_pos: vec4<f32>;
-
[[stage(vertex)]]
-fn vs_main() {
- var x: f32 = f32(i32(in_vertex_index) - 1);
- var y: f32 = f32(i32(in_vertex_index & 1) * 2 - 1);
- out_pos = vec4<f32>(x, y, 0.0, 1.0);
+fn vs_main([[builtin(vertex_index)]] in_vertex_index: u32) -> [[builtin(position)]] vec4<f32> {
+ let x = f32(i32(in_vertex_index) - 1);
+ let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
+ return vec4<f32>(x, y, 0.0, 1.0);
}
-
-[[location(0)]]
-var<out> out_color: vec4<f32>;
-
[[stage(fragment)]]
-fn fs_main() {
- out_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
+fn fs_main() -> [[location(0)]] vec4<f32> {
+ return vec4<f32>(1.0, 0.0, 0.0, 1.0);
}