Remove all use of deprecated tint APIs and WGSL syntax

Tint:
* Use the new transform::VertexFormat enum names

WGSL:
* The [[set(n)]] decoration is now [[group(n)]]
* [[builtin(vertex_idx)]] is now [[builtin(vertex_index)]]

Change-Id: I9cbf1368074488c4bb7fa81430bb12ec7581c1fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp
index 2b1873a..fb113f6 100644
--- a/examples/Animometer.cpp
+++ b/examples/Animometer.cpp
@@ -65,14 +65,14 @@
             scalar : f32;
             scalarOffset : f32;
         };
-        [[set(0), binding(0)]] var<uniform> c : Constants;
+        [[group(0), binding(0)]] var<uniform> c : Constants;
 
         struct VertexOut {
             [[location(0)]] v_color : vec4<f32>;
             [[builtin(position)]] Position : vec4<f32>;
         };
 
-        [[stage(vertex)]] fn main([[builtin(vertex_idx)]] VertexIndex : u32) -> VertexOut {
+        [[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32) -> VertexOut {
             var positions : array<vec4<f32>, 3> = array<vec4<f32>, 3>(
                 vec4<f32>( 0.0,  0.1, 0.0, 1.0),
                 vec4<f32>(-0.1, -0.1, 0.0, 1.0),
diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp
index 4a05cb1..18c8cb1 100644
--- a/src/dawn_native/ShaderModule.cpp
+++ b/src/dawn_native/ShaderModule.cpp
@@ -53,65 +53,65 @@
         tint::transform::VertexFormat ToTintVertexFormat(wgpu::VertexFormat format) {
             switch (format) {
                 case wgpu::VertexFormat::Uint8x2:
-                    return tint::transform::VertexFormat::kVec2U8;
+                    return tint::transform::VertexFormat::kUint8x2;
                 case wgpu::VertexFormat::Uint8x4:
-                    return tint::transform::VertexFormat::kVec4U8;
+                    return tint::transform::VertexFormat::kUint8x4;
                 case wgpu::VertexFormat::Sint8x2:
-                    return tint::transform::VertexFormat::kVec2I8;
+                    return tint::transform::VertexFormat::kSint8x2;
                 case wgpu::VertexFormat::Sint8x4:
-                    return tint::transform::VertexFormat::kVec4I8;
+                    return tint::transform::VertexFormat::kSint8x4;
                 case wgpu::VertexFormat::Unorm8x2:
-                    return tint::transform::VertexFormat::kVec2U8Norm;
+                    return tint::transform::VertexFormat::kUnorm8x2;
                 case wgpu::VertexFormat::Unorm8x4:
-                    return tint::transform::VertexFormat::kVec4U8Norm;
+                    return tint::transform::VertexFormat::kUnorm8x4;
                 case wgpu::VertexFormat::Snorm8x2:
-                    return tint::transform::VertexFormat::kVec2I8Norm;
+                    return tint::transform::VertexFormat::kSnorm8x2;
                 case wgpu::VertexFormat::Snorm8x4:
-                    return tint::transform::VertexFormat::kVec4I8Norm;
+                    return tint::transform::VertexFormat::kSnorm8x4;
                 case wgpu::VertexFormat::Uint16x2:
-                    return tint::transform::VertexFormat::kVec2U16;
+                    return tint::transform::VertexFormat::kUint16x2;
                 case wgpu::VertexFormat::Uint16x4:
-                    return tint::transform::VertexFormat::kVec4U16;
+                    return tint::transform::VertexFormat::kUint16x4;
                 case wgpu::VertexFormat::Sint16x2:
-                    return tint::transform::VertexFormat::kVec2I16;
+                    return tint::transform::VertexFormat::kSint16x2;
                 case wgpu::VertexFormat::Sint16x4:
-                    return tint::transform::VertexFormat::kVec4I16;
+                    return tint::transform::VertexFormat::kSint16x4;
                 case wgpu::VertexFormat::Unorm16x2:
-                    return tint::transform::VertexFormat::kVec2U16Norm;
+                    return tint::transform::VertexFormat::kUnorm16x2;
                 case wgpu::VertexFormat::Unorm16x4:
-                    return tint::transform::VertexFormat::kVec4U16Norm;
+                    return tint::transform::VertexFormat::kUnorm16x4;
                 case wgpu::VertexFormat::Snorm16x2:
-                    return tint::transform::VertexFormat::kVec2I16Norm;
+                    return tint::transform::VertexFormat::kSnorm16x2;
                 case wgpu::VertexFormat::Snorm16x4:
-                    return tint::transform::VertexFormat::kVec4I16Norm;
+                    return tint::transform::VertexFormat::kSnorm16x4;
                 case wgpu::VertexFormat::Float16x2:
-                    return tint::transform::VertexFormat::kVec2F16;
+                    return tint::transform::VertexFormat::kFloat16x2;
                 case wgpu::VertexFormat::Float16x4:
-                    return tint::transform::VertexFormat::kVec4F16;
+                    return tint::transform::VertexFormat::kFloat16x4;
                 case wgpu::VertexFormat::Float32:
-                    return tint::transform::VertexFormat::kF32;
+                    return tint::transform::VertexFormat::kFloat32;
                 case wgpu::VertexFormat::Float32x2:
-                    return tint::transform::VertexFormat::kVec2F32;
+                    return tint::transform::VertexFormat::kFloat32x2;
                 case wgpu::VertexFormat::Float32x3:
-                    return tint::transform::VertexFormat::kVec3F32;
+                    return tint::transform::VertexFormat::kFloat32x3;
                 case wgpu::VertexFormat::Float32x4:
-                    return tint::transform::VertexFormat::kVec4F32;
+                    return tint::transform::VertexFormat::kFloat32x4;
                 case wgpu::VertexFormat::Uint32:
-                    return tint::transform::VertexFormat::kU32;
+                    return tint::transform::VertexFormat::kUint32;
                 case wgpu::VertexFormat::Uint32x2:
-                    return tint::transform::VertexFormat::kVec2U32;
+                    return tint::transform::VertexFormat::kUint32x2;
                 case wgpu::VertexFormat::Uint32x3:
-                    return tint::transform::VertexFormat::kVec3U32;
+                    return tint::transform::VertexFormat::kUint32x3;
                 case wgpu::VertexFormat::Uint32x4:
-                    return tint::transform::VertexFormat::kVec4U32;
+                    return tint::transform::VertexFormat::kUint32x4;
                 case wgpu::VertexFormat::Sint32:
-                    return tint::transform::VertexFormat::kI32;
+                    return tint::transform::VertexFormat::kSint32;
                 case wgpu::VertexFormat::Sint32x2:
-                    return tint::transform::VertexFormat::kVec2I32;
+                    return tint::transform::VertexFormat::kSint32x2;
                 case wgpu::VertexFormat::Sint32x3:
-                    return tint::transform::VertexFormat::kVec3I32;
+                    return tint::transform::VertexFormat::kSint32x3;
                 case wgpu::VertexFormat::Sint32x4:
-                    return tint::transform::VertexFormat::kVec4I32;
+                    return tint::transform::VertexFormat::kSint32x4;
 
                 case wgpu::VertexFormat::Undefined:
                     break;
diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
index a118c29..bdf9093 100644
--- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
+++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
@@ -96,8 +96,8 @@
         };
 
         // TODO(crbug.com/tint/386): Use the same struct type
-        [[set(0), binding(0)]] var<storage, read_write> src : Buf1;
-        [[set(0), binding(1)]] var<storage, read_write> dst : Buf2;
+        [[group(0), binding(0)]] var<storage, read_write> src : Buf1;
+        [[group(0), binding(1)]] var<storage, read_write> dst : Buf2;
 
         [[stage(compute), workgroup_size(1)]]
         fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@@ -123,8 +123,8 @@
         };
 
         // TODO(crbug.com/tint/386): Use the same struct type
-        [[set(0), binding(0)]] var<storage, read_write> src : Buf1;
-        [[set(0), binding(1)]] var<storage, read_write> dst : Buf2;
+        [[group(0), binding(0)]] var<storage, read_write> src : Buf1;
+        [[group(0), binding(1)]] var<storage, read_write> dst : Buf2;
 
         [[stage(compute), workgroup_size(1)]]
         fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@@ -145,8 +145,8 @@
         };
 
         // TODO(crbug.com/tint/386): Use the same struct type
-        [[set(0), binding(0)]] var<storage, read_write> src : Buf1;
-        [[set(0), binding(1)]] var<storage, read_write> dst : Buf2;
+        [[group(0), binding(0)]] var<storage, read_write> src : Buf1;
+        [[group(0), binding(1)]] var<storage, read_write> dst : Buf2;
 
         [[stage(compute), workgroup_size(1)]]
         fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
diff --git a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
index b1d3c5c..0f4e46b 100644
--- a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
+++ b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
@@ -190,9 +190,9 @@
     code : u32;
 };
 
-[[set(0), binding(0)]] var<{input_qualifiers}> input : Input;
-[[set(0), binding(1)]] var<storage, read_write> output : Output;
-[[set(0), binding(2)]] var<storage, read_write> status : Status;
+[[group(0), binding(0)]] var<{input_qualifiers}> input : Input;
+[[group(0), binding(1)]] var<storage, read_write> output : Output;
+[[group(0), binding(2)]] var<storage, read_write> status : Status;
 
 [[stage(compute), workgroup_size(1,1,1)]]
 fn main() {
diff --git a/src/tests/end2end/D3D12VideoViewsTests.cpp b/src/tests/end2end/D3D12VideoViewsTests.cpp
index 67bc48c..187cbb7 100644
--- a/src/tests/end2end/D3D12VideoViewsTests.cpp
+++ b/src/tests/end2end/D3D12VideoViewsTests.cpp
@@ -297,8 +297,8 @@
     renderPipelineDescriptor.vertex.module = GetTestVertexShaderModule();
 
     renderPipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
-            [[set(0), binding(0)]] var sampler0 : sampler;
-            [[set(0), binding(1)]] var texture : texture_2d<f32>;
+            [[group(0), binding(0)]] var sampler0 : sampler;
+            [[group(0), binding(1)]] var texture : texture_2d<f32>;
 
             [[stage(fragment)]]
             fn main([[location(0)]] texCoord : vec2<f32>) -> [[location(0)]] vec4<f32> {
@@ -348,8 +348,8 @@
     renderPipelineDescriptor.vertex.module = GetTestVertexShaderModule();
 
     renderPipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
-            [[set(0), binding(0)]] var sampler0 : sampler;
-            [[set(0), binding(1)]] var texture : texture_2d<f32>;
+            [[group(0), binding(0)]] var sampler0 : sampler;
+            [[group(0), binding(1)]] var texture : texture_2d<f32>;
 
             [[stage(fragment)]]
             fn main([[location(0)]] texCoord : vec2<f32>) -> [[location(0)]] vec4<f32> {
@@ -408,9 +408,9 @@
     renderPipelineDescriptor.vertex.module = GetTestVertexShaderModule();
 
     renderPipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
-            [[set(0), binding(0)]] var sampler0 : sampler;
-            [[set(0), binding(1)]] var lumaTexture : texture_2d<f32>;
-            [[set(0), binding(2)]] var chromaTexture : texture_2d<f32>;
+            [[group(0), binding(0)]] var sampler0 : sampler;
+            [[group(0), binding(1)]] var lumaTexture : texture_2d<f32>;
+            [[group(0), binding(2)]] var chromaTexture : texture_2d<f32>;
 
             [[stage(fragment)]]
             fn main([[location(0)]] texCoord : vec2<f32>) -> [[location(0)]] vec4<f32> {
diff --git a/src/tests/end2end/ExternalTextureTests.cpp b/src/tests/end2end/ExternalTextureTests.cpp
index da16777..00de5fa 100644
--- a/src/tests/end2end/ExternalTextureTests.cpp
+++ b/src/tests/end2end/ExternalTextureTests.cpp
@@ -63,7 +63,7 @@
 
 TEST_P(ExternalTextureTests, SampleExternalTexture) {
     wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
-        [[stage(vertex)]] fn main([[builtin(vertex_idx)]] VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
+        [[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
             var positions : array<vec4<f32>, 3> = array<vec4<f32>, 3>(
                 vec4<f32>(-1.0, 1.0, 0.0, 1.0),
                 vec4<f32>(-1.0, -1.0, 0.0, 1.0),