wgsl: Replace [[decoration]] with @decoration
Deprecate the old syntax. Migrate everything to the new syntax.
Bug: tint:1382
Change-Id: Ide12b2e927b17dc93b9714c7049090864cc568d3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77260
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
diff --git a/test/samples/compute_boids.wgsl.expected.wgsl b/test/samples/compute_boids.wgsl.expected.wgsl
index 394631c..5abf9fa 100644
--- a/test/samples/compute_boids.wgsl.expected.wgsl
+++ b/test/samples/compute_boids.wgsl.expected.wgsl
@@ -1,12 +1,12 @@
-[[stage(vertex)]]
-fn vert_main([[location(0)]] a_particlePos : vec2<f32>, [[location(1)]] a_particleVel : vec2<f32>, [[location(2)]] a_pos : vec2<f32>) -> [[builtin(position)]] vec4<f32> {
+@stage(vertex)
+fn vert_main(@location(0) a_particlePos : vec2<f32>, @location(1) a_particleVel : vec2<f32>, @location(2) a_pos : vec2<f32>) -> @builtin(position) vec4<f32> {
var angle : f32 = -(atan2(a_particleVel.x, a_particleVel.y));
var pos : vec2<f32> = vec2<f32>(((a_pos.x * cos(angle)) - (a_pos.y * sin(angle))), ((a_pos.x * sin(angle)) + (a_pos.y * cos(angle))));
return vec4<f32>((pos + a_particlePos), 0.0, 1.0);
}
-[[stage(fragment)]]
-fn frag_main() -> [[location(0)]] vec4<f32> {
+@stage(fragment)
+fn frag_main() -> @location(0) vec4<f32> {
return vec4<f32>(1.0, 1.0, 1.0, 1.0);
}
@@ -29,14 +29,14 @@
particles : array<Particle, 5>;
}
-[[binding(0), group(0)]] var<uniform> params : SimParams;
+@binding(0) @group(0) var<uniform> params : SimParams;
-[[binding(1), group(0)]] var<storage, read_write> particlesA : Particles;
+@binding(1) @group(0) var<storage, read_write> particlesA : Particles;
-[[binding(2), group(0)]] var<storage, read_write> particlesB : Particles;
+@binding(2) @group(0) var<storage, read_write> particlesB : Particles;
-[[stage(compute), workgroup_size(1)]]
-fn comp_main([[builtin(global_invocation_id)]] gl_GlobalInvocationID : vec3<u32>) {
+@stage(compute) @workgroup_size(1)
+fn comp_main(@builtin(global_invocation_id) gl_GlobalInvocationID : vec3<u32>) {
var index : u32 = gl_GlobalInvocationID.x;
if ((index >= 5u)) {
return;