Update WGSL in tests with renamed builtins

These builtins have been renamed:
* frag_coord -> position
* sample_mask_in -> sample_mask
* sample_mask_out -> sample_mask

Change-Id: Ic40dc9f4e509587b7ac82e43abbf9eec68225d9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48300
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp
index ad57cfe..7af1b23 100644
--- a/examples/CppHelloTriangle.cpp
+++ b/examples/CppHelloTriangle.cpp
@@ -105,7 +105,7 @@
         [[group(0), binding(0)]] var mySampler: sampler;
         [[group(0), binding(1)]] var myTexture : texture_2d<f32>;
 
-        [[stage(fragment)]] fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>)
+        [[stage(fragment)]] fn main([[builtin(position)]] FragCoord : vec4<f32>)
                                  -> [[location(0)]] vec4<f32> {
             return textureSample(myTexture, mySampler, FragCoord.xy / vec2<f32>(640.0, 480.0));
         })");
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index 6406014..623ad50 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -256,7 +256,7 @@
         [[group(0), binding(2)]] var tex : texture_2d<f32>;
 
         [[stage(fragment)]]
-        fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
+        fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
             return textureSample(tex, samp, FragCoord.xy);
         })");
 
diff --git a/src/tests/end2end/CullingTests.cpp b/src/tests/end2end/CullingTests.cpp
index b23f885..0b5a38d 100644
--- a/src/tests/end2end/CullingTests.cpp
+++ b/src/tests/end2end/CullingTests.cpp
@@ -44,7 +44,7 @@
         // will make the pixel's R and G channels exactly equal to the pixel's x and y coordinates.
         pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
                 return vec4<f32>(
                     (FragCoord.xy - vec2<f32>(0.5, 0.5)) / vec2<f32>(255.0, 255.0),
                     0.0, 1.0);
diff --git a/src/tests/end2end/DepthStencilCopyTests.cpp b/src/tests/end2end/DepthStencilCopyTests.cpp
index b585133..b424eb8 100644
--- a/src/tests/end2end/DepthStencilCopyTests.cpp
+++ b/src/tests/end2end/DepthStencilCopyTests.cpp
@@ -256,7 +256,7 @@
             };
 
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
                 var output : FragmentOut;
                 output.result = 1u;
                 output.fragDepth = textureLoad(texture0, vec2<i32>(FragCoord.xy), 0)[0];
diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp
index 55d5b17..c252e75 100644
--- a/src/tests/end2end/MultisampledRenderingTests.cpp
+++ b/src/tests/end2end/MultisampledRenderingTests.cpp
@@ -784,7 +784,7 @@
 
         struct FragmentOut {
             [[location(0)]] color : vec4<f32>;
-            [[builtin(sample_mask_out)]] sampleMask : u32;
+            [[builtin(sample_mask)]] sampleMask : u32;
         };
 
         [[stage(fragment)]] fn main() -> FragmentOut {
@@ -847,7 +847,7 @@
         struct FragmentOut {
             [[location(0)]] color0 : vec4<f32>;
             [[location(1)]] color1 : vec4<f32>;
-            [[builtin(sample_mask_out)]] sampleMask : u32;
+            [[builtin(sample_mask)]] sampleMask : u32;
         };
 
         [[stage(fragment)]] fn main() -> FragmentOut {
diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
index 3cc3f11..79c4bd9 100644
--- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
+++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
@@ -68,7 +68,7 @@
 
             struct FragmentIn {
                 [[location(0)]] uv: vec2<f32>;
-                [[builtin(frag_coord)]] fragCoord : vec4<f32>;
+                [[builtin(position)]] fragCoord : vec4<f32>;
             };
 
             [[stage(fragment)]]
diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp
index ca031fb..4c53ecd 100644
--- a/src/tests/end2end/SamplerTests.cpp
+++ b/src/tests/end2end/SamplerTests.cpp
@@ -72,7 +72,7 @@
             [[group(0), binding(1)]] var texture0 : texture_2d<f32>;
 
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
                 return textureSample(texture0, sampler0, FragCoord.xy / vec2<f32>(2.0, 2.0));
             })");
 
diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp
index 6af57c2..bbdab96 100644
--- a/src/tests/end2end/ShaderTests.cpp
+++ b/src/tests/end2end/ShaderTests.cpp
@@ -111,7 +111,7 @@
 
     std::string fragmentShader = R"(
 [[stage(fragment)]]
-fn main([[builtin(frag_coord)]] fragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
+fn main([[builtin(position)]] fragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
     return vec4<f32>(fragCoord.xy, 0.0, 1.0);
 })";
     wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragmentShader.c_str());
@@ -191,7 +191,7 @@
     std::string fragmentShader = R"(
 struct FragmentIn {
     [[location(0)]] color : vec4<f32>;
-    [[builtin(frag_coord)]] fragCoord : vec4<f32>;
+    [[builtin(position)]] fragCoord : vec4<f32>;
 };
 
 [[stage(fragment)]]
@@ -238,7 +238,7 @@
     std::string fragmentShader = R"(
 struct FragmentIn {
     [[location(0)]] color : vec4<f32>;
-    [[builtin(frag_coord)]] fragCoord : vec4<f32>;
+    [[builtin(position)]] fragCoord : vec4<f32>;
 };
 
 [[stage(fragment)]]
diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp
index fc15b30..8899e39 100644
--- a/src/tests/end2end/TextureFormatTests.cpp
+++ b/src/tests/end2end/TextureFormatTests.cpp
@@ -162,7 +162,7 @@
         fsSource << "   [[location(0)]] color : vec4<" << type << ">;\n";
         fsSource << R"(};
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
                 var output : FragmentOut;
                 output.color = textureLoad(myTexture, vec2<i32>(FragCoord.xy), 0);
                 return output;
diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp
index a21d2d0..3f37b0f 100644
--- a/src/tests/end2end/TextureSubresourceTests.cpp
+++ b/src/tests/end2end/TextureSubresourceTests.cpp
@@ -105,7 +105,7 @@
             [[group(0), binding(1)]] var tex : texture_2d<f32>;
 
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
                 return textureSample(tex, samp, FragCoord.xy / vec2<f32>(4.0, 4.0));
             })");
 
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index 97247f7..2459ce1 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -106,7 +106,7 @@
                 [[location(0)]] color : vec4<f32>;
             };
             [[stage(fragment)]]
-            fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
+            fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
                 var output : FragmentOut;
                 output.color = textureLoad(texture0, vec2<i32>(FragCoord.xy), 0);
                 return output;
diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
index 87b9c55..36c6226 100644
--- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
@@ -139,7 +139,7 @@
         wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
             [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
             [[stage(fragment)]] fn main(
-                [[builtin(frag_coord)]] FragCoord : vec4<f32>
+                [[builtin(position)]] FragCoord : vec4<f32>
             ) -> [[location(0)]] vec4<f32> {
                 return textureLoad(image0, vec2<i32>(FragCoord.xy));
             })");
@@ -170,8 +170,8 @@
     {
         wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
             [[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
-            [[stage(fragment)]] fn main([[builtin(frag_coord)]] frag_coord : vec4<f32>) {
-                textureStore(image0, vec2<i32>(frag_coord.xy), vec4<f32>(1.0, 0.0, 0.0, 1.0));
+            [[stage(fragment)]] fn main([[builtin(position)]] position : vec4<f32>) {
+                textureStore(image0, vec2<i32>(position.xy), vec4<f32>(1.0, 0.0, 0.0, 1.0));
             })");
 
         utils::ComboRenderPipelineDescriptor2 descriptor;
diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
index 5393e22..7310941 100644
--- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp
+++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
@@ -804,7 +804,7 @@
             [[group(0), binding(3)]] var<uniform> buffer0 : U;
 
             [[stage(fragment)]] fn main(
-                [[builtin(frag_coord)]] FragCoord : vec4<f32>
+                [[builtin(position)]] FragCoord : vec4<f32>
             ) -> [[location(0)]] vec4<f32> {
                 return textureSample(texture0, sampler0, FragCoord.xy) + buffer0.color;
             })");