diff --git a/src/back/wgsl/writer.rs b/src/back/wgsl/writer.rs index b2284f457..ddceadea9 100644 --- a/src/back/wgsl/writer.rs +++ b/src/back/wgsl/writer.rs @@ -347,7 +347,7 @@ impl Writer { ShaderStage::Fragment => "fragment", ShaderStage::Compute => "compute", }; - write!(self.out, "@stage({}) ", stage_str)?; + write!(self.out, "@{} ", stage_str)?; } Attribute::WorkGroupSize(size) => { write!( diff --git a/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl b/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl index e9f9c92a6..a800b0f85 100644 --- a/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl +++ b/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl @@ -21,7 +21,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main(@location(0) v_Uv: vec2) -> FragmentOutput { v_Uv_1 = v_Uv; main_1(); diff --git a/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl b/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl index cec816f8a..365fa3470 100644 --- a/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl +++ b/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl @@ -42,7 +42,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) Vertex_Position: vec3, @location(1) Vertex_Normal: vec3, @location(2) Vertex_Uv: vec2) -> VertexOutput { Vertex_Position_1 = Vertex_Position; Vertex_Normal_1 = Vertex_Normal; diff --git a/tests/out/wgsl/210-bevy-shader-vert.wgsl b/tests/out/wgsl/210-bevy-shader-vert.wgsl index 454a426cd..f7932979b 100644 --- a/tests/out/wgsl/210-bevy-shader-vert.wgsl +++ b/tests/out/wgsl/210-bevy-shader-vert.wgsl @@ -43,7 +43,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) Vertex_Position: vec3, @location(1) Vertex_Normal: vec3, @location(2) Vertex_Uv: vec2) -> VertexOutput { Vertex_Position_1 = Vertex_Position; Vertex_Normal_1 = Vertex_Normal; diff --git a/tests/out/wgsl/246-collatz-comp.wgsl b/tests/out/wgsl/246-collatz-comp.wgsl index 03e6f1356..d54814615 100644 --- a/tests/out/wgsl/246-collatz-comp.wgsl +++ b/tests/out/wgsl/246-collatz-comp.wgsl @@ -51,7 +51,7 @@ fn main_1() { return; } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main(@builtin(global_invocation_id) param: vec3) { gl_GlobalInvocationID = param; main_1(); diff --git a/tests/out/wgsl/277-casting-vert.wgsl b/tests/out/wgsl/277-casting-vert.wgsl index 92ab6a516..3405a8b4c 100644 --- a/tests/out/wgsl/277-casting-vert.wgsl +++ b/tests/out/wgsl/277-casting-vert.wgsl @@ -3,7 +3,7 @@ fn main_1() { } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/280-matrix-cast-vert.wgsl b/tests/out/wgsl/280-matrix-cast-vert.wgsl index b5ee6454d..b9c5ec5a3 100644 --- a/tests/out/wgsl/280-matrix-cast-vert.wgsl +++ b/tests/out/wgsl/280-matrix-cast-vert.wgsl @@ -4,7 +4,7 @@ fn main_1() { let _e1 = f32(1); } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/484-preprocessor-if-vert.wgsl b/tests/out/wgsl/484-preprocessor-if-vert.wgsl index ea9cd03d5..58eb963ce 100644 --- a/tests/out/wgsl/484-preprocessor-if-vert.wgsl +++ b/tests/out/wgsl/484-preprocessor-if-vert.wgsl @@ -2,7 +2,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl b/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl index c0c1581db..d749d5a1f 100644 --- a/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl +++ b/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl @@ -32,7 +32,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) position: vec2, @location(1) color: vec4) -> VertexOutput { position_1 = position; color_1 = color; diff --git a/tests/out/wgsl/896-push-constant-vert.wgsl b/tests/out/wgsl/896-push-constant-vert.wgsl index f4892e00d..eec2204e0 100644 --- a/tests/out/wgsl/896-push-constant-vert.wgsl +++ b/tests/out/wgsl/896-push-constant-vert.wgsl @@ -8,7 +8,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/900-implicit-conversions-vert.wgsl b/tests/out/wgsl/900-implicit-conversions-vert.wgsl index 90d97dfab..7e5749c82 100644 --- a/tests/out/wgsl/900-implicit-conversions-vert.wgsl +++ b/tests/out/wgsl/900-implicit-conversions-vert.wgsl @@ -61,7 +61,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/901-lhs-field-select-vert.wgsl b/tests/out/wgsl/901-lhs-field-select-vert.wgsl index 6aa3bedd2..ec22e1d57 100644 --- a/tests/out/wgsl/901-lhs-field-select-vert.wgsl +++ b/tests/out/wgsl/901-lhs-field-select-vert.wgsl @@ -5,7 +5,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/931-constant-emitting-vert.wgsl b/tests/out/wgsl/931-constant-emitting-vert.wgsl index 515f41c62..8634d13d6 100644 --- a/tests/out/wgsl/931-constant-emitting-vert.wgsl +++ b/tests/out/wgsl/931-constant-emitting-vert.wgsl @@ -6,7 +6,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/932-for-loop-if-vert.wgsl b/tests/out/wgsl/932-for-loop-if-vert.wgsl index 3bc7924b2..2d599cca8 100644 --- a/tests/out/wgsl/932-for-loop-if-vert.wgsl +++ b/tests/out/wgsl/932-for-loop-if-vert.wgsl @@ -16,7 +16,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/access.wgsl b/tests/out/wgsl/access.wgsl index b6fc1921f..0381f76f8 100644 --- a/tests/out/wgsl/access.wgsl +++ b/tests/out/wgsl/access.wgsl @@ -78,7 +78,7 @@ fn test_arr_as_arg(a: array,5>) -> f32 { return a[4][9]; } -@stage(vertex) +@vertex fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4 { var foo: f32 = 0.0; var c: array; @@ -101,7 +101,7 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4 { return vec4((matrix * vec4(vec4(value))), 2.0); } -@stage(fragment) +@fragment fn foo_frag() -> @location(0) vec4 { bar.matrix[1][2] = 1.0; bar.matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0)); @@ -110,7 +110,7 @@ fn foo_frag() -> @location(0) vec4 { return vec4(0.0); } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn atomics() { var tmp: i32; diff --git a/tests/out/wgsl/bevy-pbr-frag.wgsl b/tests/out/wgsl/bevy-pbr-frag.wgsl index a1f49dd16..b1000381d 100644 --- a/tests/out/wgsl/bevy-pbr-frag.wgsl +++ b/tests/out/wgsl/bevy-pbr-frag.wgsl @@ -895,7 +895,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main(@location(0) v_WorldPosition: vec3, @location(1) v_WorldNormal: vec3, @location(2) v_Uv: vec2, @location(3) v_WorldTangent: vec4, @builtin(front_facing) param: bool) -> FragmentOutput { v_WorldPosition_1 = v_WorldPosition; v_WorldNormal_1 = v_WorldNormal; diff --git a/tests/out/wgsl/bevy-pbr-vert.wgsl b/tests/out/wgsl/bevy-pbr-vert.wgsl index 124914c13..ac13dcdfd 100644 --- a/tests/out/wgsl/bevy-pbr-vert.wgsl +++ b/tests/out/wgsl/bevy-pbr-vert.wgsl @@ -52,7 +52,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) Vertex_Position: vec3, @location(1) Vertex_Normal: vec3, @location(2) Vertex_Uv: vec2, @location(3) Vertex_Tangent: vec4) -> VertexOutput { Vertex_Position_1 = Vertex_Position; Vertex_Normal_1 = Vertex_Normal; diff --git a/tests/out/wgsl/binop-frag.wgsl b/tests/out/wgsl/binop-frag.wgsl index 8edf934b3..e61d2e0fb 100644 --- a/tests/out/wgsl/binop-frag.wgsl +++ b/tests/out/wgsl/binop-frag.wgsl @@ -180,7 +180,7 @@ fn main1() { return; } -@stage(fragment) +@fragment fn main() { main1(); return; diff --git a/tests/out/wgsl/bits.wgsl b/tests/out/wgsl/bits.wgsl index 60cf9cc9e..a7c3b01e4 100644 --- a/tests/out/wgsl/bits.wgsl +++ b/tests/out/wgsl/bits.wgsl @@ -1,4 +1,4 @@ -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main() { var i: i32 = 0; var i2_: vec2; diff --git a/tests/out/wgsl/bits_glsl-frag.wgsl b/tests/out/wgsl/bits_glsl-frag.wgsl index 41d259914..977e1ba5b 100644 --- a/tests/out/wgsl/bits_glsl-frag.wgsl +++ b/tests/out/wgsl/bits_glsl-frag.wgsl @@ -105,7 +105,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/boids.wgsl b/tests/out/wgsl/boids.wgsl index e166308ed..fd143f79f 100644 --- a/tests/out/wgsl/boids.wgsl +++ b/tests/out/wgsl/boids.wgsl @@ -26,7 +26,7 @@ var particlesSrc: Particles; @group(0) @binding(2) var particlesDst: Particles; -@stage(compute) @workgroup_size(64, 1, 1) +@compute @workgroup_size(64, 1, 1) fn main(@builtin(global_invocation_id) global_invocation_id: vec3) { var vPos: vec2; var vVel: vec2; diff --git a/tests/out/wgsl/bool-select-frag.wgsl b/tests/out/wgsl/bool-select-frag.wgsl index ac22cfa89..4f0e218ee 100644 --- a/tests/out/wgsl/bool-select-frag.wgsl +++ b/tests/out/wgsl/bool-select-frag.wgsl @@ -37,7 +37,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() -> FragmentOutput { main_1(); let _e3 = o_color; diff --git a/tests/out/wgsl/buffer-frag.wgsl b/tests/out/wgsl/buffer-frag.wgsl index 455fbb7af..4f561b427 100644 --- a/tests/out/wgsl/buffer-frag.wgsl +++ b/tests/out/wgsl/buffer-frag.wgsl @@ -30,7 +30,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/clamp-splat-vert.wgsl b/tests/out/wgsl/clamp-splat-vert.wgsl index 227f49aab..deeea02ef 100644 --- a/tests/out/wgsl/clamp-splat-vert.wgsl +++ b/tests/out/wgsl/clamp-splat-vert.wgsl @@ -12,7 +12,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) a_pos: vec2) -> VertexOutput { a_pos_1 = a_pos; main_1(); diff --git a/tests/out/wgsl/collatz.wgsl b/tests/out/wgsl/collatz.wgsl index e81b1fa1c..ea16c7961 100644 --- a/tests/out/wgsl/collatz.wgsl +++ b/tests/out/wgsl/collatz.wgsl @@ -31,7 +31,7 @@ fn collatz_iterations(n_base: u32) -> u32 { return _e24; } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main(@builtin(global_invocation_id) global_id: vec3) { let _e8 = v_indices.data[global_id.x]; let _e9 = collatz_iterations(_e8); diff --git a/tests/out/wgsl/constant-array-size-vert.wgsl b/tests/out/wgsl/constant-array-size-vert.wgsl index 2408f8104..16acd616e 100644 --- a/tests/out/wgsl/constant-array-size-vert.wgsl +++ b/tests/out/wgsl/constant-array-size-vert.wgsl @@ -33,7 +33,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/control-flow.wgsl b/tests/out/wgsl/control-flow.wgsl index e31585d0b..55ad20ce2 100644 --- a/tests/out/wgsl/control-flow.wgsl +++ b/tests/out/wgsl/control-flow.wgsl @@ -30,7 +30,7 @@ fn loop_switch_continue(x: i32) { return; } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main(@builtin(global_invocation_id) global_id: vec3) { var pos: i32; diff --git a/tests/out/wgsl/declarations-vert.wgsl b/tests/out/wgsl/declarations-vert.wgsl index 0c5feecb6..555407e46 100644 --- a/tests/out/wgsl/declarations-vert.wgsl +++ b/tests/out/wgsl/declarations-vert.wgsl @@ -44,7 +44,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) position: vec2, @location(1) a: vec2, @location(2) in_array: vec4, @location(3) in_array_1: vec4) -> VertexOutput { vert.position = position; vert.a = a; diff --git a/tests/out/wgsl/empty-global-name.wgsl b/tests/out/wgsl/empty-global-name.wgsl index 8d6d3f9a0..59eb9fbbc 100644 --- a/tests/out/wgsl/empty-global-name.wgsl +++ b/tests/out/wgsl/empty-global-name.wgsl @@ -11,7 +11,7 @@ fn function_() { return; } -@stage(compute) @workgroup_size(64, 1, 1) +@compute @workgroup_size(64, 1, 1) fn main() { function_(); } diff --git a/tests/out/wgsl/empty.wgsl b/tests/out/wgsl/empty.wgsl index 527a0d56c..9d1c6ac9d 100644 --- a/tests/out/wgsl/empty.wgsl +++ b/tests/out/wgsl/empty.wgsl @@ -1,4 +1,4 @@ -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main() { return; } diff --git a/tests/out/wgsl/expressions-frag.wgsl b/tests/out/wgsl/expressions-frag.wgsl index fee7c4c98..a4153c01e 100644 --- a/tests/out/wgsl/expressions-frag.wgsl +++ b/tests/out/wgsl/expressions-frag.wgsl @@ -316,7 +316,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() -> FragmentOutput { main_1(); let _e5 = o_color; diff --git a/tests/out/wgsl/extra.wgsl b/tests/out/wgsl/extra.wgsl index 0090ffad0..34a2e176c 100644 --- a/tests/out/wgsl/extra.wgsl +++ b/tests/out/wgsl/extra.wgsl @@ -10,7 +10,7 @@ struct FragmentIn { var pc: PushConstants; -@stage(fragment) +@fragment fn main(in: FragmentIn) -> @location(0) vec4 { let _e4 = pc.index; if (in.primitive_index == _e4) { diff --git a/tests/out/wgsl/fma-frag.wgsl b/tests/out/wgsl/fma-frag.wgsl index 2019e48ad..2361221f1 100644 --- a/tests/out/wgsl/fma-frag.wgsl +++ b/tests/out/wgsl/fma-frag.wgsl @@ -41,7 +41,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() -> FragmentOutput { main_1(); let _e3 = o_color; diff --git a/tests/out/wgsl/functions.wgsl b/tests/out/wgsl/functions.wgsl index 159daeb5b..62faf0e06 100644 --- a/tests/out/wgsl/functions.wgsl +++ b/tests/out/wgsl/functions.wgsl @@ -16,7 +16,7 @@ fn test_integer_dot_product() -> i32 { return c_4_; } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main() { let _e0 = test_fma(); let _e1 = test_integer_dot_product(); diff --git a/tests/out/wgsl/global-constant-array-vert.wgsl b/tests/out/wgsl/global-constant-array-vert.wgsl index 117c2e57c..6ef3214e7 100644 --- a/tests/out/wgsl/global-constant-array-vert.wgsl +++ b/tests/out/wgsl/global-constant-array-vert.wgsl @@ -6,7 +6,7 @@ fn main_1() { let _e2 = i; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/globals.wgsl b/tests/out/wgsl/globals.wgsl index 0060e40bf..42f39a097 100644 --- a/tests/out/wgsl/globals.wgsl +++ b/tests/out/wgsl/globals.wgsl @@ -40,7 +40,7 @@ fn test_msl_packed_vec3_() { let unnamed_5 = (2.0 * data.v3_); } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main() { var Foo_1: f32 = 1.0; var at: bool = true; diff --git a/tests/out/wgsl/image.wgsl b/tests/out/wgsl/image.wgsl index 4db74e0eb..6903548c0 100644 --- a/tests/out/wgsl/image.wgsl +++ b/tests/out/wgsl/image.wgsl @@ -37,7 +37,7 @@ var image_2d_depth: texture_depth_2d; @group(1) @binding(3) var image_cube_depth: texture_depth_cube; -@stage(compute) @workgroup_size(16, 1, 1) +@compute @workgroup_size(16, 1, 1) fn main(@builtin(local_invocation_id) local_id: vec3) { let dim = textureDimensions(image_storage_src); let itc = ((dim * vec2(local_id.xy)) % vec2(10, 20)); @@ -50,7 +50,7 @@ fn main(@builtin(local_invocation_id) local_id: vec3) { return; } -@stage(compute) @workgroup_size(16, 1, 1) +@compute @workgroup_size(16, 1, 1) fn depth_load(@builtin(local_invocation_id) local_id_1: vec3) { let dim_1 = textureDimensions(image_storage_src); let itc_1 = ((dim_1 * vec2(local_id_1.xy)) % vec2(10, 20)); @@ -59,7 +59,7 @@ fn depth_load(@builtin(local_invocation_id) local_id_1: vec3) { return; } -@stage(vertex) +@vertex fn queries() -> @builtin(position) vec4 { let dim_1d = textureDimensions(image_1d); let dim_1d_lod = textureDimensions(image_1d, i32(dim_1d)); @@ -78,7 +78,7 @@ fn queries() -> @builtin(position) vec4 { return vec4(f32(sum)); } -@stage(vertex) +@vertex fn levels_queries() -> @builtin(position) vec4 { let num_levels_2d = textureNumLevels(image_2d); let num_levels_2d_array = textureNumLevels(image_2d_array); @@ -92,7 +92,7 @@ fn levels_queries() -> @builtin(position) vec4 { return vec4(f32(sum_1)); } -@stage(fragment) +@fragment fn sample() -> @location(0) vec4 { let tc = vec2(0.5); let s1d = textureSample(image_1d, sampler_reg, tc.x); @@ -104,7 +104,7 @@ fn sample() -> @location(0) vec4 { return ((((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset); } -@stage(fragment) +@fragment fn sample_comparison() -> @location(0) f32 { let tc_1 = vec2(0.5); let s2d_depth = textureSampleCompare(image_2d_depth, sampler_cmp, tc_1, 0.5); @@ -113,7 +113,7 @@ fn sample_comparison() -> @location(0) f32 { return (s2d_depth + s2d_depth_level); } -@stage(fragment) +@fragment fn gather() -> @location(0) vec4 { let tc_2 = vec2(0.5); let s2d_1 = textureGather(1, image_2d, sampler_reg, tc_2); @@ -123,7 +123,7 @@ fn gather() -> @location(0) vec4 { return (((s2d_1 + s2d_offset_1) + s2d_depth_1) + s2d_depth_offset); } -@stage(fragment) +@fragment fn depth_no_comparison() -> @location(0) vec4 { let tc_3 = vec2(0.5); let s2d_2 = textureSample(image_2d_depth, sampler_reg, tc_3); diff --git a/tests/out/wgsl/images-frag.wgsl b/tests/out/wgsl/images-frag.wgsl index 18e508255..7be742365 100644 --- a/tests/out/wgsl/images-frag.wgsl +++ b/tests/out/wgsl/images-frag.wgsl @@ -137,7 +137,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/interface.wgsl b/tests/out/wgsl/interface.wgsl index fdc2a77ec..b3e30b92d 100644 --- a/tests/out/wgsl/interface.wgsl +++ b/tests/out/wgsl/interface.wgsl @@ -19,26 +19,26 @@ struct Input2_ { var output: array; -@stage(vertex) +@vertex fn vertex(@builtin(vertex_index) vertex_index: u32, @builtin(instance_index) instance_index: u32, @location(10) color: u32) -> VertexOutput { let tmp: u32 = ((vertex_index + instance_index) + color); return VertexOutput(vec4(1.0), f32(tmp)); } -@stage(fragment) +@fragment fn fragment(in: VertexOutput, @builtin(front_facing) front_facing: bool, @builtin(sample_index) sample_index: u32, @builtin(sample_mask) sample_mask: u32) -> FragmentOutput { let mask: u32 = (sample_mask & (1u << sample_index)); let color_1: f32 = select(0.0, 1.0, front_facing); return FragmentOutput(in.varying, mask, color_1); } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn compute(@builtin(global_invocation_id) global_id: vec3, @builtin(local_invocation_id) local_id: vec3, @builtin(local_invocation_index) local_index: u32, @builtin(workgroup_id) wg_id: vec3, @builtin(num_workgroups) num_wgs: vec3) { output[0] = ((((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x); return; } -@stage(vertex) +@vertex fn vertex_two_structs(in1_: Input1_, in2_: Input2_) -> @builtin(position) @invariant vec4 { var index: u32 = 2u; diff --git a/tests/out/wgsl/interpolate.wgsl b/tests/out/wgsl/interpolate.wgsl index ca3db022b..5e489a62d 100644 --- a/tests/out/wgsl/interpolate.wgsl +++ b/tests/out/wgsl/interpolate.wgsl @@ -9,7 +9,7 @@ struct FragmentInput { @location(6) @interpolate(perspective, sample) perspective_sample: f32, } -@stage(vertex) +@vertex fn vert_main() -> FragmentInput { var out: FragmentInput; @@ -25,7 +25,7 @@ fn vert_main() -> FragmentInput { return _e30; } -@stage(fragment) +@fragment fn frag_main(val: FragmentInput) { return; } diff --git a/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl b/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl index d1bd7724f..e7bee8d85 100644 --- a/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl +++ b/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl @@ -14,7 +14,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); } diff --git a/tests/out/wgsl/long-form-matrix-vert.wgsl b/tests/out/wgsl/long-form-matrix-vert.wgsl index 7b0958044..aaf6cb0eb 100644 --- a/tests/out/wgsl/long-form-matrix-vert.wgsl +++ b/tests/out/wgsl/long-form-matrix-vert.wgsl @@ -25,7 +25,7 @@ fn main_1() { let _e129 = vec4(f32(1)); } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/math-functions-vert.wgsl b/tests/out/wgsl/math-functions-vert.wgsl index 3053f0240..610adb40a 100644 --- a/tests/out/wgsl/math-functions-vert.wgsl +++ b/tests/out/wgsl/math-functions-vert.wgsl @@ -154,7 +154,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main() { main_1(); return; diff --git a/tests/out/wgsl/math-functions.wgsl b/tests/out/wgsl/math-functions.wgsl index c4ae1673a..c87270742 100644 --- a/tests/out/wgsl/math-functions.wgsl +++ b/tests/out/wgsl/math-functions.wgsl @@ -1,4 +1,4 @@ -@stage(vertex) +@vertex fn main() { let v = vec4(0.0); let a = degrees(1.0); diff --git a/tests/out/wgsl/operators.wgsl b/tests/out/wgsl/operators.wgsl index 262042296..19660d36d 100644 --- a/tests/out/wgsl/operators.wgsl +++ b/tests/out/wgsl/operators.wgsl @@ -235,7 +235,7 @@ fn assignment() { return; } -@stage(compute) @workgroup_size(1, 1, 1) +@compute @workgroup_size(1, 1, 1) fn main() { let _e4 = builtins(); let _e5 = splat(); diff --git a/tests/out/wgsl/padding.wgsl b/tests/out/wgsl/padding.wgsl index 1d3495477..06955f174 100644 --- a/tests/out/wgsl/padding.wgsl +++ b/tests/out/wgsl/padding.wgsl @@ -24,7 +24,7 @@ var input2_: Test2_; @group(0) @binding(2) var input3_: Test3_; -@stage(vertex) +@vertex fn vertex() -> @builtin(position) vec4 { let _e6 = input.b; let _e9 = input2_.b; diff --git a/tests/out/wgsl/prepostfix-frag.wgsl b/tests/out/wgsl/prepostfix-frag.wgsl index e7a32ef74..549ac805e 100644 --- a/tests/out/wgsl/prepostfix-frag.wgsl +++ b/tests/out/wgsl/prepostfix-frag.wgsl @@ -33,7 +33,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/quad-vert.wgsl b/tests/out/wgsl/quad-vert.wgsl index b56803725..fec0c94af 100644 --- a/tests/out/wgsl/quad-vert.wgsl +++ b/tests/out/wgsl/quad-vert.wgsl @@ -20,7 +20,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(1) a_uv: vec2, @location(0) a_pos: vec2) -> VertexOutput { a_uv_1 = a_uv; a_pos_1 = a_pos; diff --git a/tests/out/wgsl/quad.wgsl b/tests/out/wgsl/quad.wgsl index 5b565a281..98a4c6106 100644 --- a/tests/out/wgsl/quad.wgsl +++ b/tests/out/wgsl/quad.wgsl @@ -10,12 +10,12 @@ var u_texture: texture_2d; @group(0) @binding(1) var u_sampler: sampler; -@stage(vertex) +@vertex fn vert_main(@location(0) pos: vec2, @location(1) uv: vec2) -> VertexOutput { return VertexOutput(uv, vec4((c_scale * pos), 0.0, 1.0)); } -@stage(fragment) +@fragment fn frag_main(@location(0) uv_1: vec2) -> @location(0) vec4 { let color = textureSample(u_texture, u_sampler, uv_1); if (color.w == 0.0) { @@ -25,7 +25,7 @@ fn frag_main(@location(0) uv_1: vec2) -> @location(0) vec4 { return premultiplied; } -@stage(fragment) +@fragment fn fs_extra() -> @location(0) vec4 { return vec4(0.0, 0.5, 0.0, 0.5); } diff --git a/tests/out/wgsl/quad_glsl-frag.wgsl b/tests/out/wgsl/quad_glsl-frag.wgsl index 58cde6e33..e90e5640d 100644 --- a/tests/out/wgsl/quad_glsl-frag.wgsl +++ b/tests/out/wgsl/quad_glsl-frag.wgsl @@ -10,7 +10,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main(@location(0) v_uv: vec2) -> FragmentOutput { v_uv_1 = v_uv; main_1(); diff --git a/tests/out/wgsl/quad_glsl-vert.wgsl b/tests/out/wgsl/quad_glsl-vert.wgsl index 6fd0b186e..ea4d77401 100644 --- a/tests/out/wgsl/quad_glsl-vert.wgsl +++ b/tests/out/wgsl/quad_glsl-vert.wgsl @@ -17,7 +17,7 @@ fn main_1() { return; } -@stage(vertex) +@vertex fn main(@location(0) a_pos: vec2, @location(1) a_uv: vec2) -> VertexOutput { a_pos_1 = a_pos; a_uv_1 = a_uv; diff --git a/tests/out/wgsl/samplers-frag.wgsl b/tests/out/wgsl/samplers-frag.wgsl index 3b967fe7a..3ab0bc0c0 100644 --- a/tests/out/wgsl/samplers-frag.wgsl +++ b/tests/out/wgsl/samplers-frag.wgsl @@ -680,7 +680,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/shadow.wgsl b/tests/out/wgsl/shadow.wgsl index 2b0747df3..8bb6b5813 100644 --- a/tests/out/wgsl/shadow.wgsl +++ b/tests/out/wgsl/shadow.wgsl @@ -47,7 +47,7 @@ fn fetch_shadow(light_id: u32, homogeneous_coords: vec4) -> f32 { return _e28; } -@stage(vertex) +@vertex fn vs_main(@location(0) position: vec4, @location(1) normal: vec4) -> VertexOutput { var out: VertexOutput; @@ -62,7 +62,7 @@ fn vs_main(@location(0) position: vec4, @location(1) normal: vec4) -> return _e27; } -@stage(fragment) +@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { var color: vec3 = vec3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806); var i: u32 = 0u; @@ -93,7 +93,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4 { return (vec4(_e46, 1.0) * _e50); } -@stage(fragment) +@fragment fn fs_main_without_storage(in_1: VertexOutput) -> @location(0) vec4 { var color_1: vec3 = vec3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806); var i_1: u32 = 0u; diff --git a/tests/out/wgsl/skybox.wgsl b/tests/out/wgsl/skybox.wgsl index e40793757..c9be90196 100644 --- a/tests/out/wgsl/skybox.wgsl +++ b/tests/out/wgsl/skybox.wgsl @@ -15,7 +15,7 @@ var r_texture: texture_cube; @group(0) @binding(2) var r_sampler: sampler; -@stage(vertex) +@vertex fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput { var tmp1_: i32; var tmp2_: i32; @@ -34,7 +34,7 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput { return VertexOutput(pos, (inv_model_view * unprojected.xyz)); } -@stage(fragment) +@fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { let _e5 = textureSample(r_texture, r_sampler, in.uv); return _e5; diff --git a/tests/out/wgsl/standard.wgsl b/tests/out/wgsl/standard.wgsl index ea6a13a47..a121d6f9a 100644 --- a/tests/out/wgsl/standard.wgsl +++ b/tests/out/wgsl/standard.wgsl @@ -1,4 +1,4 @@ -@stage(fragment) +@fragment fn derivatives(@builtin(position) foo: vec4) -> @location(0) vec4 { let x = dpdx(foo); let y = dpdy(foo); diff --git a/tests/out/wgsl/swizzle_write-frag.wgsl b/tests/out/wgsl/swizzle_write-frag.wgsl index 5ca505041..1a57a2e3a 100644 --- a/tests/out/wgsl/swizzle_write-frag.wgsl +++ b/tests/out/wgsl/swizzle_write-frag.wgsl @@ -30,7 +30,7 @@ fn main_1() { return; } -@stage(fragment) +@fragment fn main() { main_1(); return; diff --git a/tests/out/wgsl/texture-arg.wgsl b/tests/out/wgsl/texture-arg.wgsl index 49d398499..09924d5eb 100644 --- a/tests/out/wgsl/texture-arg.wgsl +++ b/tests/out/wgsl/texture-arg.wgsl @@ -8,7 +8,7 @@ fn test(Passed_Texture: texture_2d, Passed_Sampler: sampler) -> vec4 { return _e7; } -@stage(fragment) +@fragment fn main() -> @location(0) vec4 { let _e2 = test(Texture, Sampler); return _e2;