[ir] Rename `sampler` in multiplanar transform.

The use of `sampler` can conflict with backend, rename it to be
`tint_sampler` to avoid any conflicts.

Change-Id: Ibd9af0ccbc3257178d11d37a78fb79cd57d62eb6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/212196
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc b/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
index 15a5dc5..68793ea 100644
--- a/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
+++ b/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
@@ -527,7 +527,7 @@
         auto* plane_0 = b.FunctionParam("plane_0", SampledTexture());
         auto* plane_1 = b.FunctionParam("plane_1", SampledTexture());
         auto* params = b.FunctionParam("params", ExternalTextureParams());
-        auto* sampler = b.FunctionParam("sampler", ty.sampler());
+        auto* sampler = b.FunctionParam("tint_sampler", ty.sampler());
         auto* coords = b.FunctionParam("coords", ty.vec2<f32>());
         texture_sample_external->SetParams({plane_0, plane_1, params, sampler, coords});
         b.Append(texture_sample_external->Block(), [&] {
diff --git a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
index ecbcd98..d5755a8 100644
--- a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
@@ -682,7 +682,7 @@
     ret %result
   }
 }
-%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> {  # %sampler_1: 'sampler', %coords_1: 'coords'
+%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %tint_sampler:sampler, %coords_1:vec2<f32>):vec4<f32> {  # %coords_1: 'coords'
   $B3: {
     %17:u32 = access %params, 1u
     %18:mat3x4<f32> = access %params, 2u
@@ -698,16 +698,16 @@
     %28:bool = eq %27, 1u
     %29:vec3<f32>, %30:f32 = if %28 [t: $B4, f: $B5] {  # if_1
       $B4: {  # true
-        %31:vec4<f32> = textureSampleLevel %plane_0, %sampler_1, %26, 0.0f
+        %31:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %26, 0.0f
         %32:vec3<f32> = swizzle %31, xyz
         %33:f32 = access %31, 3u
         exit_if %32, %33  # if_1
       }
       $B5: {  # false
-        %34:vec4<f32> = textureSampleLevel %plane_0, %sampler_1, %26, 0.0f
+        %34:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %26, 0.0f
         %35:f32 = access %34, 0u
         %36:vec2<f32> = clamp %25, %22, %23
-        %37:vec4<f32> = textureSampleLevel %plane_1, %sampler_1, %36, 0.0f
+        %37:vec4<f32> = textureSampleLevel %plane_1, %tint_sampler, %36, 0.0f
         %38:vec2<f32> = swizzle %37, xy
         %39:vec4<f32> = construct %35, %38, 1.0f
         %40:vec3<f32> = mul %39, %18
@@ -870,7 +870,7 @@
     ret %result_1
   }
 }
-%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_2:sampler, %coords_2:vec2<f32>):vec4<f32> {  # %sampler_2: 'sampler', %coords_2: 'coords'
+%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %tint_sampler:sampler, %coords_2:vec2<f32>):vec4<f32> {  # %coords_2: 'coords'
   $B4: {
     %24:u32 = access %params, 1u
     %25:mat3x4<f32> = access %params, 2u
@@ -886,16 +886,16 @@
     %35:bool = eq %34, 1u
     %36:vec3<f32>, %37:f32 = if %35 [t: $B5, f: $B6] {  # if_1
       $B5: {  # true
-        %38:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %33, 0.0f
+        %38:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %33, 0.0f
         %39:vec3<f32> = swizzle %38, xyz
         %40:f32 = access %38, 3u
         exit_if %39, %40  # if_1
       }
       $B6: {  # false
-        %41:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %33, 0.0f
+        %41:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %33, 0.0f
         %42:f32 = access %41, 0u
         %43:vec2<f32> = clamp %32, %29, %30
-        %44:vec4<f32> = textureSampleLevel %plane_1, %sampler_2, %43, 0.0f
+        %44:vec4<f32> = textureSampleLevel %plane_1, %tint_sampler, %43, 0.0f
         %45:vec2<f32> = swizzle %44, xy
         %46:vec4<f32> = construct %42, %45, 1.0f
         %47:vec3<f32> = mul %46, %25
@@ -1091,7 +1091,7 @@
     ret %33
   }
 }
-%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_2:sampler, %coords_2:vec2<f32>):vec4<f32> {  # %sampler_2: 'sampler', %coords_2: 'coords'
+%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %tint_sampler:sampler, %coords_2:vec2<f32>):vec4<f32> {  # %coords_2: 'coords'
   $B4: {
     %39:u32 = access %params, 1u
     %40:mat3x4<f32> = access %params, 2u
@@ -1107,16 +1107,16 @@
     %50:bool = eq %49, 1u
     %51:vec3<f32>, %52:f32 = if %50 [t: $B5, f: $B6] {  # if_1
       $B5: {  # true
-        %53:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %48, 0.0f
+        %53:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %48, 0.0f
         %54:vec3<f32> = swizzle %53, xyz
         %55:f32 = access %53, 3u
         exit_if %54, %55  # if_1
       }
       $B6: {  # false
-        %56:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %48, 0.0f
+        %56:vec4<f32> = textureSampleLevel %plane_0, %tint_sampler, %48, 0.0f
         %57:f32 = access %56, 0u
         %58:vec2<f32> = clamp %47, %44, %45
-        %59:vec4<f32> = textureSampleLevel %plane_1, %sampler_2, %58, 0.0f
+        %59:vec4<f32> = textureSampleLevel %plane_1, %tint_sampler, %58, 0.0f
         %60:vec2<f32> = swizzle %59, xy
         %61:vec4<f32> = construct %57, %60, 1.0f
         %62:vec3<f32> = mul %61, %40
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
index eacd66a..fde0c05 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
@@ -52,19 +52,19 @@
   return (((v_3 < v_2)) ? ((v_4 * ((params.C * v_3) + params.F))) : ((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E))));
 }
 
-float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState sampler, float2 coords) {
+float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState tint_sampler, float2 coords) {
   float2 v_5 = mul(float3(coords, 1.0f), params.sampleTransform);
   float2 v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = (0.0f).xxx;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 v_9 = plane_0.SampleLevel(sampler, v_6, float(0.0f));
+    float4 v_9 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float v_10 = plane_0.SampleLevel(sampler, v_6, float(0.0f))[0u];
+    float v_10 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f))[0u];
     float2 v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(sampler, v_11, float(0.0f)).xy, 1.0f));
+    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(tint_sampler, v_11, float(0.0f)).xy, 1.0f));
     v_8 = 1.0f;
   }
   float3 v_12 = v_7;
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
index 90c599c..fde0c05 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 struct tint_GammaTransferParams {
   float G;
   float A;
@@ -54,19 +52,19 @@
   return (((v_3 < v_2)) ? ((v_4 * ((params.C * v_3) + params.F))) : ((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E))));
 }
 
-float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState sampler, float2 coords) {
+float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState tint_sampler, float2 coords) {
   float2 v_5 = mul(float3(coords, 1.0f), params.sampleTransform);
   float2 v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = (0.0f).xxx;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 v_9 = plane_0.SampleLevel(sampler, v_6, float(0.0f));
+    float4 v_9 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float v_10 = plane_0.SampleLevel(sampler, v_6, float(0.0f))[0u];
+    float v_10 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f))[0u];
     float2 v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(sampler, v_11, float(0.0f)).xy, 1.0f));
+    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(tint_sampler, v_11, float(0.0f)).xy, 1.0f));
     v_8 = 1.0f;
   }
   float3 v_12 = v_7;
@@ -134,15 +132,13 @@
   uint4 v_54 = arg_0_params[((256u + start_byte_offset) / 16u)];
   uint2 v_55 = ((((((256u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_54.zw) : (v_54.xy));
   uint4 v_56 = arg_0_params[((264u + start_byte_offset) / 16u)];
-  tint_GammaTransferParams v_57 = v_41;
-  tint_GammaTransferParams v_58 = v_42;
-  tint_ExternalTextureParams v_59 = {v_38, v_39, v_40, v_57, v_58, v_43, v_44, v_45, v_47, v_49, v_51, v_53, v_55, asfloat(((((((264u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_56.zw) : (v_56.xy)))};
-  return v_59;
+  tint_ExternalTextureParams v_57 = {v_38, v_39, v_40, v_41, v_42, v_43, v_44, v_45, v_47, v_49, v_51, v_53, v_55, asfloat(((((((264u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_56.zw) : (v_56.xy)))};
+  return v_57;
 }
 
 float4 textureSampleBaseClampToEdge_7c04e6() {
-  tint_ExternalTextureParams v_60 = v_37(0u);
-  float4 res = tint_TextureSampleExternal(arg_0_plane0, arg_0_plane1, v_60, arg_1, (1.0f).xx);
+  tint_ExternalTextureParams v_58 = v_37(0u);
+  float4 res = tint_TextureSampleExternal(arg_0_plane0, arg_0_plane1, v_58, arg_1, (1.0f).xx);
   return res;
 }
 
@@ -159,21 +155,13 @@
   VertexOutput tint_symbol = (VertexOutput)0;
   tint_symbol.pos = (0.0f).xxxx;
   tint_symbol.prevent_dce = textureSampleBaseClampToEdge_7c04e6();
-  VertexOutput v_61 = tint_symbol;
-  return v_61;
+  VertexOutput v_59 = tint_symbol;
+  return v_59;
 }
 
 vertex_main_outputs vertex_main() {
-  VertexOutput v_62 = vertex_main_inner();
-  VertexOutput v_63 = v_62;
-  VertexOutput v_64 = v_62;
-  vertex_main_outputs v_65 = {v_64.prevent_dce, v_63.pos};
-  return v_65;
+  VertexOutput v_60 = vertex_main_inner();
+  vertex_main_outputs v_61 = {v_60.prevent_dce, v_60.pos};
+  return v_61;
 }
 
-FXC validation failure:
-<scrubbed_path>(55,137-143): error X3000: syntax error: unexpected token 'sampler'
-<scrubbed_path>(56,27-32): error X3004: undeclared identifier 'coords'
-
-
-tint executable returned error: exit status 1
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
index 7164c70..2c7271f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
@@ -90,19 +90,19 @@
   return select((v_4 * (powr(((params.A * v_3) + params.B), v_1) + params.E)), (v_4 * ((params.C * v_3) + params.F)), (v_3 < v_2));
 }
 
-float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler sampler, float2 coords) {
+float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler tint_sampler, float2 coords) {
   float2 const v_5 = (params.sampleTransform * float3(coords, 1.0f));
   float2 const v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = 0.0f;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 const v_9 = plane_0.sample(sampler, v_6, level(0.0f));
+    float4 const v_9 = plane_0.sample(tint_sampler, v_6, level(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float const v_10 = plane_0.sample(sampler, v_6, level(0.0f))[0u];
+    float const v_10 = plane_0.sample(tint_sampler, v_6, level(0.0f))[0u];
     float2 const v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = (float4(v_10, plane_1.sample(sampler, v_11, level(0.0f)).xy, 1.0f) * params.yuvToRgbConversionMatrix);
+    v_7 = (float4(v_10, plane_1.sample(tint_sampler, v_11, level(0.0f)).xy, 1.0f) * params.yuvToRgbConversionMatrix);
     v_8 = 1.0f;
   }
   float3 const v_12 = v_7;
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 706007f..f2b141e 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -79,7 +79,7 @@
                OpName %plane_0 "plane_0"
                OpName %plane_1 "plane_1"
                OpName %params "params"
-               OpName %sampler "sampler"
+               OpName %tint_sampler "tint_sampler"
                OpName %coords "coords"
                OpName %tint_GammaCorrection "tint_GammaCorrection"
                OpName %v "v"
@@ -256,7 +256,7 @@
     %plane_0 = OpFunctionParameter %8
     %plane_1 = OpFunctionParameter %8
      %params = OpFunctionParameter %tint_ExternalTextureParams
-    %sampler = OpFunctionParameter %22
+%tint_sampler = OpFunctionParameter %22
      %coords = OpFunctionParameter %v2float
          %80 = OpLabel
          %81 = OpCompositeExtract %uint %params 1
@@ -274,17 +274,17 @@
                OpSelectionMerge %95 None
                OpBranchConditional %93 %96 %97
          %96 = OpLabel
-         %98 = OpSampledImage %99 %plane_0 %sampler
+         %98 = OpSampledImage %99 %plane_0 %tint_sampler
         %100 = OpImageSampleExplicitLod %v4float %98 %90 Lod %float_0
         %102 = OpVectorShuffle %v3float %100 %100 0 1 2
         %103 = OpCompositeExtract %float %100 3
                OpBranch %95
          %97 = OpLabel
-        %104 = OpSampledImage %99 %plane_0 %sampler
+        %104 = OpSampledImage %99 %plane_0 %tint_sampler
         %105 = OpImageSampleExplicitLod %v4float %104 %90 Lod %float_0
         %106 = OpCompositeExtract %float %105 0
         %107 = OpExtInst %v2float %91 NClamp %89 %86 %87
-        %108 = OpSampledImage %99 %plane_1 %sampler
+        %108 = OpSampledImage %99 %plane_1 %tint_sampler
         %109 = OpImageSampleExplicitLod %v4float %108 %107 Lod %float_0
         %110 = OpVectorShuffle %v2float %109 %109 0 1
         %111 = OpCompositeConstruct %v4float %106 %110 %float_1
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
index 473c7d0..bc54125 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.dxc.hlsl
@@ -52,19 +52,19 @@
   return (((v_3 < v_2)) ? ((v_4 * ((params.C * v_3) + params.F))) : ((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E))));
 }
 
-float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState sampler, float2 coords) {
+float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState tint_sampler, float2 coords) {
   float2 v_5 = mul(float3(coords, 1.0f), params.sampleTransform);
   float2 v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = (0.0f).xxx;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 v_9 = plane_0.SampleLevel(sampler, v_6, float(0.0f));
+    float4 v_9 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float v_10 = plane_0.SampleLevel(sampler, v_6, float(0.0f))[0u];
+    float v_10 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f))[0u];
     float2 v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(sampler, v_11, float(0.0f)).xy, 1.0f));
+    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(tint_sampler, v_11, float(0.0f)).xy, 1.0f));
     v_8 = 1.0f;
   }
   float3 v_12 = v_7;
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
index 4252915..bc54125 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.fxc.hlsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 struct tint_GammaTransferParams {
   float G;
   float A;
@@ -54,19 +52,19 @@
   return (((v_3 < v_2)) ? ((v_4 * ((params.C * v_3) + params.F))) : ((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E))));
 }
 
-float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState sampler, float2 coords) {
+float4 tint_TextureSampleExternal(Texture2D<float4> plane_0, Texture2D<float4> plane_1, tint_ExternalTextureParams params, SamplerState tint_sampler, float2 coords) {
   float2 v_5 = mul(float3(coords, 1.0f), params.sampleTransform);
   float2 v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = (0.0f).xxx;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 v_9 = plane_0.SampleLevel(sampler, v_6, float(0.0f));
+    float4 v_9 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float v_10 = plane_0.SampleLevel(sampler, v_6, float(0.0f))[0u];
+    float v_10 = plane_0.SampleLevel(tint_sampler, v_6, float(0.0f))[0u];
     float2 v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(sampler, v_11, float(0.0f)).xy, 1.0f));
+    v_7 = mul(params.yuvToRgbConversionMatrix, float4(v_10, plane_1.SampleLevel(tint_sampler, v_11, float(0.0f)).xy, 1.0f));
     v_8 = 1.0f;
   }
   float3 v_12 = v_7;
@@ -134,17 +132,14 @@
   uint4 v_54 = arg_0_params[((256u + start_byte_offset) / 16u)];
   uint2 v_55 = ((((((256u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_54.zw) : (v_54.xy));
   uint4 v_56 = arg_0_params[((264u + start_byte_offset) / 16u)];
-  tint_GammaTransferParams v_57 = v_41;
-  tint_GammaTransferParams v_58 = v_42;
-  tint_ExternalTextureParams v_59 = {v_38, v_39, v_40, v_57, v_58, v_43, v_44, v_45, v_47, v_49, v_51, v_53, v_55, asfloat(((((((264u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_56.zw) : (v_56.xy)))};
-  return v_59;
+  tint_ExternalTextureParams v_57 = {v_38, v_39, v_40, v_41, v_42, v_43, v_44, v_45, v_47, v_49, v_51, v_53, v_55, asfloat(((((((264u + start_byte_offset) % 16u) / 4u) == 2u)) ? (v_56.zw) : (v_56.xy)))};
+  return v_57;
 }
 
 float4 textureSampleBaseClampToEdge_7c04e6() {
   float2 arg_2 = (1.0f).xx;
-  tint_ExternalTextureParams v_60 = v_37(0u);
-  tint_ExternalTextureParams v_61 = v_60;
-  float4 res = tint_TextureSampleExternal(arg_0_plane0, arg_0_plane1, v_61, arg_1, arg_2);
+  tint_ExternalTextureParams v_58 = v_37(0u);
+  float4 res = tint_TextureSampleExternal(arg_0_plane0, arg_0_plane1, v_58, arg_1, arg_2);
   return res;
 }
 
@@ -161,21 +156,13 @@
   VertexOutput tint_symbol = (VertexOutput)0;
   tint_symbol.pos = (0.0f).xxxx;
   tint_symbol.prevent_dce = textureSampleBaseClampToEdge_7c04e6();
-  VertexOutput v_62 = tint_symbol;
-  return v_62;
+  VertexOutput v_59 = tint_symbol;
+  return v_59;
 }
 
 vertex_main_outputs vertex_main() {
-  VertexOutput v_63 = vertex_main_inner();
-  VertexOutput v_64 = v_63;
-  VertexOutput v_65 = v_63;
-  vertex_main_outputs v_66 = {v_65.prevent_dce, v_64.pos};
-  return v_66;
+  VertexOutput v_60 = vertex_main_inner();
+  vertex_main_outputs v_61 = {v_60.prevent_dce, v_60.pos};
+  return v_61;
 }
 
-FXC validation failure:
-<scrubbed_path>(55,137-143): error X3000: syntax error: unexpected token 'sampler'
-<scrubbed_path>(56,27-32): error X3004: undeclared identifier 'coords'
-
-
-tint executable returned error: exit status 1
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
index f0df346..f8fc00f 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
@@ -90,19 +90,19 @@
   return select((v_4 * (powr(((params.A * v_3) + params.B), v_1) + params.E)), (v_4 * ((params.C * v_3) + params.F)), (v_3 < v_2));
 }
 
-float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler sampler, float2 coords) {
+float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler tint_sampler, float2 coords) {
   float2 const v_5 = (params.sampleTransform * float3(coords, 1.0f));
   float2 const v_6 = clamp(v_5, params.samplePlane0RectMin, params.samplePlane0RectMax);
   float3 v_7 = 0.0f;
   float v_8 = 0.0f;
   if ((params.numPlanes == 1u)) {
-    float4 const v_9 = plane_0.sample(sampler, v_6, level(0.0f));
+    float4 const v_9 = plane_0.sample(tint_sampler, v_6, level(0.0f));
     v_7 = v_9.xyz;
     v_8 = v_9[3u];
   } else {
-    float const v_10 = plane_0.sample(sampler, v_6, level(0.0f))[0u];
+    float const v_10 = plane_0.sample(tint_sampler, v_6, level(0.0f))[0u];
     float2 const v_11 = clamp(v_5, params.samplePlane1RectMin, params.samplePlane1RectMax);
-    v_7 = (float4(v_10, plane_1.sample(sampler, v_11, level(0.0f)).xy, 1.0f) * params.yuvToRgbConversionMatrix);
+    v_7 = (float4(v_10, plane_1.sample(tint_sampler, v_11, level(0.0f)).xy, 1.0f) * params.yuvToRgbConversionMatrix);
     v_8 = 1.0f;
   }
   float3 const v_12 = v_7;
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 8519191..4cb634e 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -80,7 +80,7 @@
                OpName %plane_0 "plane_0"
                OpName %plane_1 "plane_1"
                OpName %params "params"
-               OpName %sampler "sampler"
+               OpName %tint_sampler "tint_sampler"
                OpName %coords "coords"
                OpName %tint_GammaCorrection "tint_GammaCorrection"
                OpName %v "v"
@@ -261,7 +261,7 @@
     %plane_0 = OpFunctionParameter %8
     %plane_1 = OpFunctionParameter %8
      %params = OpFunctionParameter %tint_ExternalTextureParams
-    %sampler = OpFunctionParameter %22
+%tint_sampler = OpFunctionParameter %22
      %coords = OpFunctionParameter %v2float
          %83 = OpLabel
          %84 = OpCompositeExtract %uint %params 1
@@ -279,17 +279,17 @@
                OpSelectionMerge %98 None
                OpBranchConditional %96 %99 %100
          %99 = OpLabel
-        %101 = OpSampledImage %102 %plane_0 %sampler
+        %101 = OpSampledImage %102 %plane_0 %tint_sampler
         %103 = OpImageSampleExplicitLod %v4float %101 %93 Lod %float_0
         %105 = OpVectorShuffle %v3float %103 %103 0 1 2
         %106 = OpCompositeExtract %float %103 3
                OpBranch %98
         %100 = OpLabel
-        %107 = OpSampledImage %102 %plane_0 %sampler
+        %107 = OpSampledImage %102 %plane_0 %tint_sampler
         %108 = OpImageSampleExplicitLod %v4float %107 %93 Lod %float_0
         %109 = OpCompositeExtract %float %108 0
         %110 = OpExtInst %v2float %94 NClamp %92 %89 %90
-        %111 = OpSampledImage %102 %plane_1 %sampler
+        %111 = OpSampledImage %102 %plane_1 %tint_sampler
         %112 = OpImageSampleExplicitLod %v4float %111 %110 Lod %float_0
         %113 = OpVectorShuffle %v2float %112 %112 0 1
         %114 = OpCompositeConstruct %v4float %109 %113 %float_1