writer/msl: Fix texture intrinsic generation

Wrap the texture expression in parentheses when it has lower
precendence than the function call operator.

Cast integer coordinates to unsigned integers as required by MSL.

Fixed: tint:536
Change-Id: I957e6be3c51044959e25e0be96c2d2c65db18187
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53962
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl
index e696093..32ca94e 100644
--- a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl
@@ -1,25 +1,12 @@
-SKIP: FAILED
-
-
-
-Validation Failure:
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_6a9113() {
-  float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
+void textureSampleBias_6a9113(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+  float4 res = tint_symbol.sample(tint_symbol_1, float2(), bias(1.0f));
 }
 
-fragment void fragment_main() {
-  textureSampleBias_6a9113();
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(1)]]) {
+  textureSampleBias_6a9113(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-
-tint_n6HLQB.metal:5:16: error: use of undeclared identifier 'arg_0'
-  float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
-               ^
-tint_n6HLQB.metal:5:29: error: use of undeclared identifier 'arg_1'
-  float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
-                            ^
-2 errors generated.