[msl] Add polyfill for textureSampleLevel()

Add a `level` builtin type to use for constructing the lod_options
argument.

Bug: 42251016
Change-Id: I9ca35b9ffcb1833dfdbea18bf29ce5c41295db8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193202
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/src/tint/cmd/test/BUILD.bazel b/src/tint/cmd/test/BUILD.bazel
index 06eb564..de049c2 100644
--- a/src/tint/cmd/test/BUILD.bazel
+++ b/src/tint/cmd/test/BUILD.bazel
@@ -53,6 +53,7 @@
     "//src/tint/lang/core:test",
     "//src/tint/lang/hlsl/writer/common:test",
     "//src/tint/lang/msl/ir:test",
+    "//src/tint/lang/msl/type:test",
     "//src/tint/lang/spirv/ir:test",
     "//src/tint/lang/spirv/reader/lower:test",
     "//src/tint/lang/spirv/type:test",
diff --git a/src/tint/cmd/test/BUILD.cmake b/src/tint/cmd/test/BUILD.cmake
index 974ed9a..cb94ba9 100644
--- a/src/tint/cmd/test/BUILD.cmake
+++ b/src/tint/cmd/test/BUILD.cmake
@@ -54,6 +54,7 @@
   tint_lang_core_test
   tint_lang_hlsl_writer_common_test
   tint_lang_msl_ir_test
+  tint_lang_msl_type_test
   tint_lang_spirv_ir_test
   tint_lang_spirv_reader_lower_test
   tint_lang_spirv_type_test
diff --git a/src/tint/cmd/test/BUILD.gn b/src/tint/cmd/test/BUILD.gn
index 98932c7..7d0c39c 100644
--- a/src/tint/cmd/test/BUILD.gn
+++ b/src/tint/cmd/test/BUILD.gn
@@ -59,6 +59,7 @@
       "${tint_src_dir}/lang/core/type:unittests",
       "${tint_src_dir}/lang/hlsl/writer/common:unittests",
       "${tint_src_dir}/lang/msl/ir:unittests",
+      "${tint_src_dir}/lang/msl/type:unittests",
       "${tint_src_dir}/lang/spirv/ir:unittests",
       "${tint_src_dir}/lang/spirv/reader/lower:unittests",
       "${tint_src_dir}/lang/spirv/type:unittests",
diff --git a/src/tint/lang/msl/BUILD.cmake b/src/tint/lang/msl/BUILD.cmake
index 40cbc8e..ab1dba6 100644
--- a/src/tint/lang/msl/BUILD.cmake
+++ b/src/tint/lang/msl/BUILD.cmake
@@ -36,6 +36,7 @@
 
 include(lang/msl/intrinsic/BUILD.cmake)
 include(lang/msl/ir/BUILD.cmake)
+include(lang/msl/type/BUILD.cmake)
 include(lang/msl/validate/BUILD.cmake)
 include(lang/msl/writer/BUILD.cmake)
 
diff --git a/src/tint/lang/msl/intrinsic/BUILD.bazel b/src/tint/lang/msl/intrinsic/BUILD.bazel
index d4b9fab..6034d5a 100644
--- a/src/tint/lang/msl/intrinsic/BUILD.bazel
+++ b/src/tint/lang/msl/intrinsic/BUILD.bazel
@@ -43,6 +43,7 @@
   ],
   hdrs = [
     "dialect.h",
+    "type_matchers.h",
   ],
   deps = [
     "//src/tint/lang/core",
@@ -50,6 +51,7 @@
     "//src/tint/lang/core/intrinsic",
     "//src/tint/lang/core/type",
     "//src/tint/lang/msl",
+    "//src/tint/lang/msl/type",
     "//src/tint/utils/containers",
     "//src/tint/utils/diagnostic",
     "//src/tint/utils/ice",
diff --git a/src/tint/lang/msl/intrinsic/BUILD.cmake b/src/tint/lang/msl/intrinsic/BUILD.cmake
index 3ede760..1d0f45a 100644
--- a/src/tint/lang/msl/intrinsic/BUILD.cmake
+++ b/src/tint/lang/msl/intrinsic/BUILD.cmake
@@ -41,6 +41,7 @@
 tint_add_target(tint_lang_msl_intrinsic lib
   lang/msl/intrinsic/data.cc
   lang/msl/intrinsic/dialect.h
+  lang/msl/intrinsic/type_matchers.h
 )
 
 tint_target_add_dependencies(tint_lang_msl_intrinsic lib
@@ -49,6 +50,7 @@
   tint_lang_core_intrinsic
   tint_lang_core_type
   tint_lang_msl
+  tint_lang_msl_type
   tint_utils_containers
   tint_utils_diagnostic
   tint_utils_ice
diff --git a/src/tint/lang/msl/intrinsic/BUILD.gn b/src/tint/lang/msl/intrinsic/BUILD.gn
index 2351f59..fad6dbe 100644
--- a/src/tint/lang/msl/intrinsic/BUILD.gn
+++ b/src/tint/lang/msl/intrinsic/BUILD.gn
@@ -42,6 +42,7 @@
   sources = [
     "data.cc",
     "dialect.h",
+    "type_matchers.h",
   ]
   deps = [
     "${tint_src_dir}/lang/core",
@@ -49,6 +50,7 @@
     "${tint_src_dir}/lang/core/intrinsic",
     "${tint_src_dir}/lang/core/type",
     "${tint_src_dir}/lang/msl",
+    "${tint_src_dir}/lang/msl/type",
     "${tint_src_dir}/utils/containers",
     "${tint_src_dir}/utils/diagnostic",
     "${tint_src_dir}/utils/ice",
diff --git a/src/tint/lang/msl/intrinsic/data.cc b/src/tint/lang/msl/intrinsic/data.cc
index 6b7dd8d..0375e4e 100644
--- a/src/tint/lang/msl/intrinsic/data.cc
+++ b/src/tint/lang/msl/intrinsic/data.cc
@@ -39,6 +39,7 @@
 
 #include "src/tint/lang/core/intrinsic/type_matchers.h"
 #include "src/tint/lang/msl/intrinsic/dialect.h"
+#include "src/tint/lang/msl/intrinsic/type_matchers.h"
 #include "src/tint/utils/text/string_stream.h"
 
 namespace tint::msl::intrinsic {
@@ -570,6 +571,20 @@
 };
 
 
+/// TypeMatcher for 'type level'
+constexpr TypeMatcher kLevelMatcher {
+/* match */ [](MatchState& state, const Type* ty) -> const Type* {
+    if (!MatchLevel(state, ty)) {
+      return nullptr;
+    }
+    return BuildLevel(state, ty);
+  },
+/* print */ []([[maybe_unused]] MatchState* state, StyledText& out) {
+    out << style::Type("level");
+  }
+};
+
+
 /// TypeMatcher for 'match iu32'
 constexpr TypeMatcher kIu32Matcher {
 /* match */ [](MatchState& state, const Type* ty) -> const Type* {
@@ -774,8 +789,9 @@
   /* [26] */ kTextureStorage2DMatcher,
   /* [27] */ kTextureStorage2DArrayMatcher,
   /* [28] */ kTextureStorage3DMatcher,
-  /* [29] */ kIu32Matcher,
-  /* [30] */ kFiu32Matcher,
+  /* [29] */ kLevelMatcher,
+  /* [30] */ kIu32Matcher,
+  /* [31] */ kFiu32Matcher,
 };
 
 /// The template numbers, and number matchers
@@ -925,8 +941,8 @@
   /* [128] */ MatcherIndex(6),
   /* [129] */ MatcherIndex(18),
   /* [130] */ MatcherIndex(6),
-  /* [131] */ MatcherIndex(29),
-  /* [132] */ MatcherIndex(30),
+  /* [131] */ MatcherIndex(30),
+  /* [132] */ MatcherIndex(31),
   /* [133] */ MatcherIndex(19),
   /* [134] */ MatcherIndex(20),
   /* [135] */ MatcherIndex(21),
@@ -934,6 +950,7 @@
   /* [137] */ MatcherIndex(23),
   /* [138] */ MatcherIndex(2),
   /* [139] */ MatcherIndex(12),
+  /* [140] */ MatcherIndex(29),
 };
 
 static_assert(MatcherIndicesIndex::CanIndex(kMatcherIndices),
@@ -942,135 +959,135 @@
 constexpr ParameterInfo kParameters[] = {
   {
     /* [0] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(0),
-  },
-  {
-    /* [1] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(5),
-  },
-  {
-    /* [2] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [3] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
-  },
-  {
-    /* [4] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
-  },
-  {
-    /* [5] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(121),
   },
   {
-    /* [6] */
+    /* [1] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
+    /* [2] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(117),
+  },
+  {
+    /* [3] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [4] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [5] */
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(119),
+  },
+  {
+    /* [6] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(134),
+  },
+  {
     /* [7] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(117),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [8] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [9] */
-    /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(119),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [10] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(134),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
   },
   {
     /* [11] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(139),
-  },
-  {
-    /* [12] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(117),
-  },
-  {
-    /* [13] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [14] */
     /* usage */ core::ParameterUsage::kOffset,
     /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
-    /* [15] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* [12] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(0),
   },
   {
-    /* [16] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
+    /* [13] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(5),
   },
   {
-    /* [17] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(1),
-  },
-  {
-    /* [18] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(138),
-  },
-  {
-    /* [19] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(134),
-  },
-  {
-    /* [20] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
-    /* [21] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* [14] */
+    /* usage */ core::ParameterUsage::kNone,
     /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
-    /* [22] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(1),
+    /* [15] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [23] */
+    /* [16] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [17] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(115),
+    /* matcher_indices */ MatcherIndicesIndex(121),
   },
   {
-    /* [24] */
+    /* [18] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
-    /* [25] */
+    /* [19] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
+    /* [20] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [21] */
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(119),
+  },
+  {
+    /* [22] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(134),
+  },
+  {
+    /* [23] */
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
+  },
+  {
+    /* [24] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(117),
+  },
+  {
+    /* [25] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
     /* [26] */
     /* usage */ core::ParameterUsage::kOffset,
     /* matcher_indices */ MatcherIndicesIndex(119),
@@ -1078,7 +1095,7 @@
   {
     /* [27] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(123),
+    /* matcher_indices */ MatcherIndicesIndex(115),
   },
   {
     /* [28] */
@@ -1088,107 +1105,107 @@
   {
     /* [29] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(125),
-  },
-  {
-    /* [30] */
-    /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(22),
-  },
-  {
-    /* [31] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(129),
-  },
-  {
-    /* [32] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(139),
-  },
-  {
-    /* [33] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(125),
-  },
-  {
-    /* [34] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [35] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(133),
-  },
-  {
-    /* [36] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(139),
-  },
-  {
-    /* [37] */
-    /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
-    /* [38] */
+    /* [30] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [31] */
     /* usage */ core::ParameterUsage::kOffset,
     /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
-    /* [39] */
+    /* [32] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(136),
+    /* matcher_indices */ MatcherIndicesIndex(123),
   },
   {
-    /* [40] */
+    /* [33] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
-    /* [41] */
+    /* [34] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
-    /* [42] */
+    /* [35] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [36] */
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(22),
+  },
+  {
+    /* [37] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(129),
+  },
+  {
+    /* [38] */
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
+  },
+  {
+    /* [39] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(125),
+  },
+  {
+    /* [40] */
     /* usage */ core::ParameterUsage::kArrayIndex,
     /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
+    /* [41] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [42] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(133),
+  },
+  {
     /* [43] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(63),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [44] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(111),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [45] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
   },
   {
     /* [46] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [47] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(75),
+    /* matcher_indices */ MatcherIndicesIndex(136),
   },
   {
     /* [48] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(34),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [49] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [50] */
@@ -1197,13 +1214,13 @@
   },
   {
     /* [51] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(87),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
   },
   {
     /* [52] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(70),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(97),
   },
   {
     /* [53] */
@@ -1213,212 +1230,212 @@
   {
     /* [54] */
     /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [55] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(0),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(138),
   },
   {
     /* [56] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(134),
   },
   {
     /* [57] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
-  },
-  {
-    /* [58] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(95),
-  },
-  {
-    /* [59] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
-    /* [60] */
+    /* [58] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [59] */
     /* usage */ core::ParameterUsage::kLevel,
     /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
-    /* [61] */
+    /* [60] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(99),
+    /* matcher_indices */ MatcherIndicesIndex(115),
+  },
+  {
+    /* [61] */
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [62] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(58),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [63] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(1),
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [64] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(123),
   },
   {
     /* [65] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [66] */
-    /* usage */ core::ParameterUsage::kSampleIndex,
-    /* matcher_indices */ MatcherIndicesIndex(1),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [67] */
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(22),
+  },
+  {
+    /* [68] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(133),
   },
   {
-    /* [68] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
     /* [69] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [70] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(137),
-  },
-  {
-    /* [71] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
-    /* [72] */
-    /* usage */ core::ParameterUsage::kSampleIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [73] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(27),
-  },
-  {
-    /* [74] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
-    /* [75] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [76] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(39),
-  },
-  {
-    /* [77] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
-    /* [78] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [79] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(51),
-  },
-  {
-    /* [80] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(109),
-  },
-  {
-    /* [81] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [82] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(113),
-  },
-  {
-    /* [83] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
-    /* [84] */
+    /* [70] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
-    /* [85] */
+    /* [71] */
+    /* usage */ core::ParameterUsage::kOffset,
+    /* matcher_indices */ MatcherIndicesIndex(119),
+  },
+  {
+    /* [72] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(127),
   },
   {
-    /* [86] */
+    /* [73] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
-    /* [87] */
+    /* [74] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
-    /* [88] */
+    /* [75] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [76] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(135),
   },
   {
-    /* [89] */
+    /* [77] */
     /* usage */ core::ParameterUsage::kSampler,
     /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
-    /* [90] */
+    /* [78] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
-    /* [91] */
+    /* [79] */
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(140),
+  },
+  {
+    /* [80] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(57),
+    /* matcher_indices */ MatcherIndicesIndex(63),
+  },
+  {
+    /* [81] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
+  },
+  {
+    /* [82] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [83] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [84] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(75),
+  },
+  {
+    /* [85] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
+  },
+  {
+    /* [86] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [87] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [88] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(87),
+  },
+  {
+    /* [89] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
+  },
+  {
+    /* [90] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [91] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [92] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(111),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(0),
   },
   {
     /* [93] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [94] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(60),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [95] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(111),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(95),
   },
   {
     /* [96] */
@@ -1427,13 +1444,13 @@
   },
   {
     /* [97] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(66),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [98] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(111),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(99),
   },
   {
     /* [99] */
@@ -1442,28 +1459,28 @@
   },
   {
     /* [100] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(69),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [101] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(34),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(105),
   },
   {
     /* [102] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [103] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(72),
+    /* usage */ core::ParameterUsage::kSampleIndex,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [104] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(34),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(133),
   },
   {
     /* [105] */
@@ -1472,43 +1489,43 @@
   },
   {
     /* [106] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(78),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [107] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(34),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(137),
   },
   {
     /* [108] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(58),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [109] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(81),
+    /* usage */ core::ParameterUsage::kSampleIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [110] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(70),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(27),
   },
   {
     /* [111] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [112] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(84),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [113] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(70),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(39),
   },
   {
     /* [114] */
@@ -1517,251 +1534,406 @@
   },
   {
     /* [115] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(90),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [116] */
-    /* usage */ core::ParameterUsage::kValue,
-    /* matcher_indices */ MatcherIndicesIndex(70),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(51),
   },
   {
     /* [117] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(58),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [118] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(0),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [119] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(113),
   },
   {
     /* [120] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(95),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [121] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(6),
   },
   {
     /* [122] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(57),
   },
   {
     /* [123] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [124] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(99),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [125] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(60),
   },
   {
     /* [126] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(101),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [127] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [128] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(103),
+    /* matcher_indices */ MatcherIndicesIndex(66),
   },
   {
     /* [129] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [130] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(133),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
     /* [131] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(69),
   },
   {
     /* [132] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(134),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [133] */
-    /* usage */ core::ParameterUsage::kNone,
+    /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [134] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(135),
+    /* matcher_indices */ MatcherIndicesIndex(72),
   },
   {
     /* [135] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [136] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(136),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [137] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(78),
   },
   {
     /* [138] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(12),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [139] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
     /* [140] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(15),
+    /* matcher_indices */ MatcherIndicesIndex(81),
   },
   {
     /* [141] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [142] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(18),
-  },
-  {
-    /* [143] */
-    /* usage */ core::ParameterUsage::kNone,
+    /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [144] */
+    /* [143] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(93),
+    /* matcher_indices */ MatcherIndicesIndex(84),
+  },
+  {
+    /* [144] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [145] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [146] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(21),
+    /* matcher_indices */ MatcherIndicesIndex(90),
   },
   {
     /* [147] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
+  },
+  {
+    /* [148] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
+  },
+  {
+    /* [149] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(0),
+  },
+  {
+    /* [150] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [151] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(95),
+  },
+  {
+    /* [152] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [153] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(97),
+  },
+  {
+    /* [154] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [155] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(99),
+  },
+  {
+    /* [156] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [157] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(101),
+  },
+  {
+    /* [158] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [159] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(103),
+  },
+  {
+    /* [160] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [161] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(133),
+  },
+  {
+    /* [162] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [163] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(134),
+  },
+  {
+    /* [164] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [165] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(135),
+  },
+  {
+    /* [166] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [167] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(136),
+  },
+  {
+    /* [168] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [169] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(12),
+  },
+  {
+    /* [170] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [171] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(15),
+  },
+  {
+    /* [172] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [173] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(18),
+  },
+  {
+    /* [174] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [175] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(93),
+  },
+  {
+    /* [176] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [148] */
+    /* [177] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(21),
+  },
+  {
+    /* [178] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [179] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(24),
   },
   {
-    /* [149] */
+    /* [180] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
-    /* [150] */
+    /* [181] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(30),
   },
   {
-    /* [151] */
+    /* [182] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
-    /* [152] */
+    /* [183] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(33),
   },
   {
-    /* [153] */
+    /* [184] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [154] */
+    /* [185] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(36),
   },
   {
-    /* [155] */
+    /* [186] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
-    /* [156] */
+    /* [187] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(42),
   },
   {
-    /* [157] */
+    /* [188] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
-    /* [158] */
+    /* [189] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(45),
   },
   {
-    /* [159] */
+    /* [190] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [160] */
+    /* [191] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(48),
   },
   {
-    /* [161] */
+    /* [192] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
-    /* [162] */
+    /* [193] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(54),
   },
   {
-    /* [163] */
+    /* [194] */
     /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
-    /* [164] */
+    /* [195] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(9),
   },
@@ -1845,321 +2017,321 @@
 constexpr OverloadInfo kOverloads[] = {
   {
     /* [0] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(144),
-    /* return_matcher_indices */ MatcherIndicesIndex(107),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(119),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [1] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(7),
-    /* parameters */ ParameterIndex(58),
-    /* return_matcher_indices */ MatcherIndicesIndex(107),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(27),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [2] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 3,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(15),
-    /* return_matcher_indices */ MatcherIndicesIndex(107),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(60),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [3] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(7),
-    /* parameters */ ParameterIndex(61),
-    /* return_matcher_indices */ MatcherIndicesIndex(107),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(0),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [4] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(9),
-    /* parameters */ ParameterIndex(64),
-    /* return_matcher_indices */ MatcherIndicesIndex(107),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(17),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [5] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(2),
-    /* parameters */ ParameterIndex(67),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(32),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [6] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(19),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(64),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [7] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(10),
-    /* parameters */ ParameterIndex(70),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(72),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [8] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(146),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(37),
     /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [9] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(148),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* parameters */ ParameterIndex(42),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [10] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(73),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(68),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [11] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(150),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(6),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [12] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(152),
-    /* return_matcher_indices */ MatcherIndicesIndex(34),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(22),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [13] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(154),
-    /* return_matcher_indices */ MatcherIndicesIndex(34),
+    /* parameters */ ParameterIndex(76),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [14] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(76),
-    /* return_matcher_indices */ MatcherIndicesIndex(34),
+    /* parameters */ ParameterIndex(47),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [15] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(156),
-    /* return_matcher_indices */ MatcherIndicesIndex(34),
+    /* parameters */ ParameterIndex(27),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [16] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(158),
-    /* return_matcher_indices */ MatcherIndicesIndex(70),
+    /* parameters */ ParameterIndex(27),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [17] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(160),
-    /* return_matcher_indices */ MatcherIndicesIndex(70),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(0),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [18] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 6,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(79),
-    /* return_matcher_indices */ MatcherIndicesIndex(70),
+    /* parameters */ ParameterIndex(0),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [19] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(162),
-    /* return_matcher_indices */ MatcherIndicesIndex(70),
+    /* parameters */ ParameterIndex(32),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [20] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(144),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(32),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [21] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(120),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(72),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [22] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(122),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(37),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [23] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(124),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(42),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [24] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(126),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(42),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [25] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(128),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(6),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [26] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 6,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(64),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(6),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [27] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(130),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* parameters */ ParameterIndex(76),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [28] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(132),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(47),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2167,241 +2339,241 @@
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(134),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(175),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [30] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(136),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(7),
+    /* parameters */ ParameterIndex(95),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [31] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(70),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 3,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(52),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [32] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(164),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(7),
+    /* parameters */ ParameterIndex(98),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [33] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(138),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(9),
+    /* parameters */ ParameterIndex(101),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [34] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(140),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(2),
+    /* parameters */ ParameterIndex(104),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [35] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(142),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(56),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [36] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(82),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(10),
+    /* parameters */ ParameterIndex(107),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [37] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(23),
+    /* parameters */ ParameterIndex(177),
     /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [38] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(23),
+    /* parameters */ ParameterIndex(179),
     /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [39] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(5),
+    /* parameters */ ParameterIndex(110),
     /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [40] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 5,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(5),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(181),
     /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [41] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(27),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* parameters */ ParameterIndex(183),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [42] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(27),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* parameters */ ParameterIndex(185),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [43] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(85),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(113),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [44] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(31),
-    /* return_matcher_indices */ MatcherIndicesIndex(111),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(187),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [45] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(35),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(189),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [46] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(35),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(191),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [47] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(10),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(116),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [48] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 5,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(10),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(193),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [49] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(88),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(175),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [50] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(39),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(151),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2411,7 +2583,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(120),
+    /* parameters */ ParameterIndex(153),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2422,7 +2594,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(122),
+    /* parameters */ ParameterIndex(155),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2433,7 +2605,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(124),
+    /* parameters */ ParameterIndex(157),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2444,29 +2616,29 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(126),
+    /* parameters */ ParameterIndex(159),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [55] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(128),
+    /* parameters */ ParameterIndex(101),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [56] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(64),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(161),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2477,7 +2649,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(130),
+    /* parameters */ ParameterIndex(163),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2488,7 +2660,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(132),
+    /* parameters */ ParameterIndex(165),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2499,18 +2671,18 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(134),
+    /* parameters */ ParameterIndex(167),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [60] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(136),
+    /* parameters */ ParameterIndex(107),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2519,9 +2691,9 @@
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(70),
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(195),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2532,7 +2704,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(138),
+    /* parameters */ ParameterIndex(169),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2543,7 +2715,7 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(140),
+    /* parameters */ ParameterIndex(171),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2554,260 +2726,414 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(142),
+    /* parameters */ ParameterIndex(173),
     /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [65] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(91),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(151),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [66] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(94),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(153),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [67] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(43),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(155),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [68] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(97),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(157),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [69] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(100),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(159),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [70] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(103),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(101),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [71] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(47),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(161),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [72] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(106),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* parameters */ ParameterIndex(163),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [73] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(109),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* parameters */ ParameterIndex(165),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [74] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(112),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* parameters */ ParameterIndex(167),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [75] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 4,
+    /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(51),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(107),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [76] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 3,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 0,
-    /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(115),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(169),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [77] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(164),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* parameters */ ParameterIndex(171),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [78] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(138),
-    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* parameters */ ParameterIndex(173),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [79] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(140),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(122),
     /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [80] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 1,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(142),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(125),
     /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [81] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(124),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(80),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [82] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
-    /* num_parameters */ 2,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(142),
-    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(128),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [83] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* num_parameters */ 5,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(0),
-    /* return_matcher_indices */ MatcherIndicesIndex(4),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(131),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [84] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(55),
-    /* return_matcher_indices */ MatcherIndicesIndex(3),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(134),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [85] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* num_parameters */ 2,
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(118),
-    /* return_matcher_indices */ MatcherIndicesIndex(3),
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(84),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [86] */
-    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 2,
-    /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(55),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(137),
     /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [87] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(140),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [88] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(143),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [89] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 4,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(1),
+    /* parameters */ ParameterIndex(88),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [90] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 3,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(146),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [91] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 1,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(195),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [92] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 1,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(169),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [93] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 1,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(171),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [94] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 1,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(173),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [95] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(155),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [96] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline, OverloadFlag::kMemberFunction),
+    /* num_parameters */ 2,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(173),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [97] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* num_parameters */ 5,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(3),
+    /* parameters */ ParameterIndex(12),
+    /* return_matcher_indices */ MatcherIndicesIndex(4),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [98] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* num_parameters */ 3,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(3),
+    /* parameters */ ParameterIndex(92),
+    /* return_matcher_indices */ MatcherIndicesIndex(3),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [99] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* num_parameters */ 2,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(3),
+    /* parameters */ ParameterIndex(149),
+    /* return_matcher_indices */ MatcherIndicesIndex(3),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [100] */
+    /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
+    /* num_parameters */ 3,
+    /* num_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(3),
+    /* parameters */ ParameterIndex(92),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [101] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(3),
+    /* parameters */ ParameterIndex(15),
     /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
@@ -2821,67 +3147,67 @@
     /* [0] */
     /* fn atomic_compare_exchange_weak_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, ptr<function, T, read_write>, T, u32, u32) -> bool */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(83),
+    /* overloads */ OverloadIndex(97),
   },
   {
     /* [1] */
     /* fn atomic_exchange_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [2] */
     /* fn atomic_fetch_add_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [3] */
     /* fn atomic_fetch_and_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [4] */
     /* fn atomic_fetch_max_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [5] */
     /* fn atomic_fetch_min_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [6] */
     /* fn atomic_fetch_or_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [7] */
     /* fn atomic_fetch_sub_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [8] */
     /* fn atomic_fetch_xor_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(84),
+    /* overloads */ OverloadIndex(98),
   },
   {
     /* [9] */
     /* fn atomic_load_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(85),
+    /* overloads */ OverloadIndex(99),
   },
   {
     /* [10] */
     /* fn atomic_store_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(86),
+    /* overloads */ OverloadIndex(100),
   },
   {
     /* [11] */
@@ -2890,7 +3216,7 @@
     /* fn fence[F : texel_format, A : access](texture: texture_storage_2d_array<F, A>) */
     /* fn fence[F : texel_format, A : access](texture: texture_storage_3d<F, A>) */
     /* num overloads */ 4,
-    /* overloads */ OverloadIndex(77),
+    /* overloads */ OverloadIndex(91),
   },
   {
     /* [12] */
@@ -2911,7 +3237,7 @@
     /* fn get_width[F : texel_format, A : access](texture: texture_storage_2d_array<F, A>, u32) -> u32 */
     /* fn get_width[F : texel_format, A : access](texture: texture_storage_3d<F, A>, u32) -> u32 */
     /* num overloads */ 16,
-    /* overloads */ OverloadIndex(20),
+    /* overloads */ OverloadIndex(49),
   },
   {
     /* [13] */
@@ -2930,14 +3256,14 @@
     /* fn get_height[F : texel_format, A : access](texture: texture_storage_2d_array<F, A>, u32) -> u32 */
     /* fn get_height[F : texel_format, A : access](texture: texture_storage_3d<F, A>, u32) -> u32 */
     /* num overloads */ 14,
-    /* overloads */ OverloadIndex(51),
+    /* overloads */ OverloadIndex(65),
   },
   {
     /* [14] */
     /* fn get_depth[T : fiu32](texture: texture_3d<T>, u32) -> u32 */
     /* fn get_depth[F : texel_format, A : access](texture: texture_storage_3d<F, A>, u32) -> u32 */
     /* num overloads */ 2,
-    /* overloads */ OverloadIndex(81),
+    /* overloads */ OverloadIndex(95),
   },
   {
     /* [15] */
@@ -2962,7 +3288,7 @@
     /* fn read[A : iu32](texture: texture_storage_2d_array<u32_texel_format, readable>, coords: vec2<u32>, array_index: A) -> vec4<u32> */
     /* fn read(texture: texture_storage_3d<u32_texel_format, readable>, coords: vec3<u32>) -> vec4<u32> */
     /* num overloads */ 20,
-    /* overloads */ OverloadIndex(0),
+    /* overloads */ OverloadIndex(29),
   },
   {
     /* [16] */
@@ -2981,8 +3307,22 @@
     /* fn sample[A : iu32](texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> f32 */
     /* fn sample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> f32 */
     /* fn sample[A : iu32](texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> f32 */
-    /* num overloads */ 15,
-    /* overloads */ OverloadIndex(36),
+    /* fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: level) -> vec4<f32> */
+    /* fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: level, @const offset: vec2<i32>) -> vec4<f32> */
+    /* fn sample[A : iu32](texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: level) -> vec4<f32> */
+    /* fn sample[A : iu32](texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: level, @const offset: vec2<i32>) -> vec4<f32> */
+    /* fn sample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: level) -> vec4<f32> */
+    /* fn sample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: level, @const offset: vec3<i32>) -> vec4<f32> */
+    /* fn sample(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, level: level) -> vec4<f32> */
+    /* fn sample[A : iu32](texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, level: level) -> vec4<f32> */
+    /* fn sample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: level) -> f32 */
+    /* fn sample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: level, @const offset: vec2<i32>) -> f32 */
+    /* fn sample[A : iu32](texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: level) -> f32 */
+    /* fn sample[A : iu32](texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: level, @const offset: vec2<i32>) -> f32 */
+    /* fn sample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: level) -> f32 */
+    /* fn sample[A : iu32](texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A, level: level) -> f32 */
+    /* num overloads */ 29,
+    /* overloads */ OverloadIndex(0),
   },
   {
     /* [17] */
@@ -2999,13 +3339,13 @@
     /* fn write[A : iu32](texture: texture_storage_2d_array<u32_texel_format, writable>, value: vec4<u32>, coords: vec2<u32>, array_index: A) */
     /* fn write(texture: texture_storage_3d<u32_texel_format, writable>, value: vec4<u32>, coords: vec3<u32>) */
     /* num overloads */ 12,
-    /* overloads */ OverloadIndex(65),
+    /* overloads */ OverloadIndex(79),
   },
   {
     /* [18] */
     /* fn threadgroup_barrier(u32) */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(87),
+    /* overloads */ OverloadIndex(101),
   },
 };
 
diff --git a/src/tint/lang/msl/intrinsic/data.cc.tmpl b/src/tint/lang/msl/intrinsic/data.cc.tmpl
index 2314b5a..9c7444b 100644
--- a/src/tint/lang/msl/intrinsic/data.cc.tmpl
+++ b/src/tint/lang/msl/intrinsic/data.cc.tmpl
@@ -21,6 +21,7 @@
 
 #include "src/tint/lang/core/intrinsic/type_matchers.h"
 #include "src/tint/lang/msl/intrinsic/dialect.h"
+#include "src/tint/lang/msl/intrinsic/type_matchers.h"
 #include "src/tint/utils/text/string_stream.h"
 
 namespace tint::msl::intrinsic {
diff --git a/src/tint/lang/msl/intrinsic/type_matchers.h b/src/tint/lang/msl/intrinsic/type_matchers.h
new file mode 100644
index 0000000..34fea33
--- /dev/null
+++ b/src/tint/lang/msl/intrinsic/type_matchers.h
@@ -0,0 +1,51 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SRC_TINT_LANG_MSL_INTRINSIC_TYPE_MATCHERS_H_
+#define SRC_TINT_LANG_MSL_INTRINSIC_TYPE_MATCHERS_H_
+
+#include "src/tint/lang/core/intrinsic/table.h"
+#include "src/tint/lang/core/type/manager.h"
+#include "src/tint/lang/msl/type/level.h"
+
+namespace tint::msl::intrinsic {
+
+inline bool MatchLevel(core::intrinsic::MatchState&, const core::type::Type* ty) {
+    if (ty->Is<msl::type::Level>()) {
+        return true;
+    }
+    return false;
+}
+
+inline const core::type::Type* BuildLevel(core::intrinsic::MatchState& state,
+                                          const core::type::Type*) {
+    return state.types.Get<type::Level>();
+}
+
+}  // namespace tint::msl::intrinsic
+
+#endif  // SRC_TINT_LANG_MSL_INTRINSIC_TYPE_MATCHERS_H_
diff --git a/src/tint/lang/msl/msl.def b/src/tint/lang/msl/msl.def
index 58e942b..84f0625 100644
--- a/src/tint/lang/msl/msl.def
+++ b/src/tint/lang/msl/msl.def
@@ -109,6 +109,9 @@
 type texture_storage_2d_array<F: texel_format, A: access>
 type texture_storage_3d<F: texel_format, A: access>
 
+// sampling options types
+type level
+
 ////////////////////////////////////////////////////////////////////////////////
 // Type matchers                                                              //
 ////////////////////////////////////////////////////////////////////////////////
@@ -192,6 +195,7 @@
 @member_function fn read[A: iu32](texture: texture_storage_2d_array<u32_texel_format, readable>, coords: vec2<u32>, array_index: A) -> vec4<u32>
 @member_function fn read(texture: texture_storage_3d<u32_texel_format, readable>, coords: vec3<u32>) -> vec4<u32>
 
+// Sample with implicit LOD.
 @member_function @stage("fragment") fn sample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32>
 @member_function @stage("fragment") fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 @member_function @stage("fragment") fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
@@ -208,6 +212,22 @@
 @member_function @stage("fragment") fn sample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> f32
 @member_function @stage("fragment") fn sample[A: iu32](texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> f32
 
+// Sample with explicit LOD.
+@member_function fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: level) -> vec4<f32>
+@member_function fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: level, @const offset: vec2<i32>) -> vec4<f32>
+@member_function fn sample[A: iu32](texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: level) -> vec4<f32>
+@member_function fn sample[A: iu32](texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: level, @const offset: vec2<i32>) -> vec4<f32>
+@member_function fn sample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: level) -> vec4<f32>
+@member_function fn sample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: level, @const offset: vec3<i32>) -> vec4<f32>
+@member_function fn sample(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, level: level) -> vec4<f32>
+@member_function fn sample[A: iu32](texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, level: level) -> vec4<f32>
+@member_function fn sample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: level) -> f32
+@member_function fn sample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: level, @const offset: vec2<i32>) -> f32
+@member_function fn sample[A: iu32](texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: level) -> f32
+@member_function fn sample[A: iu32](texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: level, @const offset: vec2<i32>) -> f32
+@member_function fn sample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: level) -> f32
+@member_function fn sample[A: iu32](texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A, level: level) -> f32
+
 @member_function fn write(texture: texture_storage_1d<f32_texel_format, writable>, value: vec4<f32>, coords: u32)
 @member_function fn write(texture: texture_storage_2d<f32_texel_format, writable>, value: vec4<f32>, coords: vec2<u32>)
 @member_function fn write[A: iu32](texture: texture_storage_2d_array<f32_texel_format, writable>, value: vec4<f32>, coords: vec2<u32>, array_index: A)
diff --git a/src/tint/lang/msl/type/BUILD.bazel b/src/tint/lang/msl/type/BUILD.bazel
new file mode 100644
index 0000000..000b381
--- /dev/null
+++ b/src/tint/lang/msl/type/BUILD.bazel
@@ -0,0 +1,88 @@
+# Copyright 2024 The Dawn & Tint Authors
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+#    list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+################################################################################
+# File generated by 'tools/src/cmd/gen' using the template:
+#   tools/src/cmd/gen/build/BUILD.bazel.tmpl
+#
+# To regenerate run: './tools/run gen'
+#
+#                       Do not modify this file directly
+################################################################################
+
+load("//src/tint:flags.bzl", "COPTS")
+load("@bazel_skylib//lib:selects.bzl", "selects")
+cc_library(
+  name = "type",
+  srcs = [
+    "level.cc",
+  ],
+  hdrs = [
+    "level.h",
+  ],
+  deps = [
+    "//src/tint/lang/core",
+    "//src/tint/lang/core/type",
+    "//src/tint/utils/containers",
+    "//src/tint/utils/diagnostic",
+    "//src/tint/utils/ice",
+    "//src/tint/utils/id",
+    "//src/tint/utils/macros",
+    "//src/tint/utils/math",
+    "//src/tint/utils/memory",
+    "//src/tint/utils/reflection",
+    "//src/tint/utils/result",
+    "//src/tint/utils/rtti",
+    "//src/tint/utils/symbol",
+    "//src/tint/utils/text",
+    "//src/tint/utils/traits",
+  ],
+  copts = COPTS,
+  visibility = ["//visibility:public"],
+)
+cc_library(
+  name = "test",
+  alwayslink = True,
+  srcs = [
+    "level_test.cc",
+  ],
+  deps = [
+    "//src/tint/lang/core/type",
+    "//src/tint/lang/msl/type",
+    "//src/tint/utils/containers",
+    "//src/tint/utils/ice",
+    "//src/tint/utils/macros",
+    "//src/tint/utils/math",
+    "//src/tint/utils/memory",
+    "//src/tint/utils/rtti",
+    "//src/tint/utils/traits",
+    "@gtest",
+  ],
+  copts = COPTS,
+  visibility = ["//visibility:public"],
+)
+
diff --git a/src/tint/lang/msl/type/BUILD.cmake b/src/tint/lang/msl/type/BUILD.cmake
new file mode 100644
index 0000000..efb43fe
--- /dev/null
+++ b/src/tint/lang/msl/type/BUILD.cmake
@@ -0,0 +1,86 @@
+# Copyright 2024 The Dawn & Tint Authors
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+#    list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+################################################################################
+# File generated by 'tools/src/cmd/gen' using the template:
+#   tools/src/cmd/gen/build/BUILD.cmake.tmpl
+#
+# To regenerate run: './tools/run gen'
+#
+#                       Do not modify this file directly
+################################################################################
+
+################################################################################
+# Target:    tint_lang_msl_type
+# Kind:      lib
+################################################################################
+tint_add_target(tint_lang_msl_type lib
+  lang/msl/type/level.cc
+  lang/msl/type/level.h
+)
+
+tint_target_add_dependencies(tint_lang_msl_type lib
+  tint_lang_core
+  tint_lang_core_type
+  tint_utils_containers
+  tint_utils_diagnostic
+  tint_utils_ice
+  tint_utils_id
+  tint_utils_macros
+  tint_utils_math
+  tint_utils_memory
+  tint_utils_reflection
+  tint_utils_result
+  tint_utils_rtti
+  tint_utils_symbol
+  tint_utils_text
+  tint_utils_traits
+)
+
+################################################################################
+# Target:    tint_lang_msl_type_test
+# Kind:      test
+################################################################################
+tint_add_target(tint_lang_msl_type_test test
+  lang/msl/type/level_test.cc
+)
+
+tint_target_add_dependencies(tint_lang_msl_type_test test
+  tint_lang_core_type
+  tint_lang_msl_type
+  tint_utils_containers
+  tint_utils_ice
+  tint_utils_macros
+  tint_utils_math
+  tint_utils_memory
+  tint_utils_rtti
+  tint_utils_traits
+)
+
+tint_target_add_external_dependencies(tint_lang_msl_type_test test
+  "gtest"
+)
diff --git a/src/tint/lang/msl/type/BUILD.gn b/src/tint/lang/msl/type/BUILD.gn
new file mode 100644
index 0000000..613c307
--- /dev/null
+++ b/src/tint/lang/msl/type/BUILD.gn
@@ -0,0 +1,84 @@
+# Copyright 2024 The Dawn & Tint Authors
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+#    list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+################################################################################
+# File generated by 'tools/src/cmd/gen' using the template:
+#   tools/src/cmd/gen/build/BUILD.gn.tmpl
+#
+# To regenerate run: './tools/run gen'
+#
+#                       Do not modify this file directly
+################################################################################
+
+import("../../../../../scripts/tint_overrides_with_defaults.gni")
+
+import("${tint_src_dir}/tint.gni")
+
+if (tint_build_unittests || tint_build_benchmarks) {
+  import("//testing/test.gni")
+}
+
+libtint_source_set("type") {
+  sources = [
+    "level.cc",
+    "level.h",
+  ]
+  deps = [
+    "${tint_src_dir}/lang/core",
+    "${tint_src_dir}/lang/core/type",
+    "${tint_src_dir}/utils/containers",
+    "${tint_src_dir}/utils/diagnostic",
+    "${tint_src_dir}/utils/ice",
+    "${tint_src_dir}/utils/id",
+    "${tint_src_dir}/utils/macros",
+    "${tint_src_dir}/utils/math",
+    "${tint_src_dir}/utils/memory",
+    "${tint_src_dir}/utils/reflection",
+    "${tint_src_dir}/utils/result",
+    "${tint_src_dir}/utils/rtti",
+    "${tint_src_dir}/utils/symbol",
+    "${tint_src_dir}/utils/text",
+    "${tint_src_dir}/utils/traits",
+  ]
+}
+if (tint_build_unittests) {
+  tint_unittests_source_set("unittests") {
+    sources = [ "level_test.cc" ]
+    deps = [
+      "${tint_src_dir}:gmock_and_gtest",
+      "${tint_src_dir}/lang/core/type",
+      "${tint_src_dir}/lang/msl/type",
+      "${tint_src_dir}/utils/containers",
+      "${tint_src_dir}/utils/ice",
+      "${tint_src_dir}/utils/macros",
+      "${tint_src_dir}/utils/math",
+      "${tint_src_dir}/utils/memory",
+      "${tint_src_dir}/utils/rtti",
+      "${tint_src_dir}/utils/traits",
+    ]
+  }
+}
diff --git a/src/tint/lang/msl/type/level.cc b/src/tint/lang/msl/type/level.cc
new file mode 100644
index 0000000..76397e9
--- /dev/null
+++ b/src/tint/lang/msl/type/level.cc
@@ -0,0 +1,58 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/msl/type/level.h"
+
+#include <cstddef>
+#include <string>
+
+#include "src/tint/lang/core/type/clone_context.h"
+#include "src/tint/lang/core/type/manager.h"
+#include "src/tint/lang/core/type/unique_node.h"
+#include "src/tint/utils/math/hash.h"
+#include "src/tint/utils/rtti/castable.h"
+
+TINT_INSTANTIATE_TYPEINFO(tint::msl::type::Level);
+
+namespace tint::msl::type {
+
+Level::Level()
+    : Base(static_cast<size_t>(Hash(tint::TypeCode::Of<Level>().bits)), core::type::Flags{}) {}
+
+bool Level::Equals(const UniqueNode& other) const {
+    return other.Is<Level>();
+}
+
+std::string Level::FriendlyName() const {
+    return "msl.level";
+}
+
+Level* Level::Clone(core::type::CloneContext& ctx) const {
+    return ctx.dst.mgr->Get<Level>();
+}
+
+}  // namespace tint::msl::type
diff --git a/src/tint/lang/msl/type/level.h b/src/tint/lang/msl/type/level.h
new file mode 100644
index 0000000..79d723f
--- /dev/null
+++ b/src/tint/lang/msl/type/level.h
@@ -0,0 +1,57 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SRC_TINT_LANG_MSL_TYPE_LEVEL_H_
+#define SRC_TINT_LANG_MSL_TYPE_LEVEL_H_
+
+#include <string>
+
+#include "src/tint/lang/core/type/type.h"
+
+namespace tint::msl::type {
+
+/// Level represents the `metal::level` type.
+class Level final : public Castable<Level, core::type::Type> {
+  public:
+    /// Constructor
+    Level();
+
+    /// @param other the other node to compare against
+    /// @returns true if the this type is equal to @p other
+    bool Equals(const UniqueNode& other) const override;
+
+    /// @returns the friendly name for this type
+    std::string FriendlyName() const override;
+
+    /// @param ctx the clone context
+    /// @returns a clone of this type
+    Level* Clone(core::type::CloneContext& ctx) const override;
+};
+
+}  // namespace tint::msl::type
+
+#endif  // SRC_TINT_LANG_MSL_TYPE_LEVEL_H_
diff --git a/src/tint/lang/msl/type/level_test.cc b/src/tint/lang/msl/type/level_test.cc
new file mode 100644
index 0000000..28c3dfd
--- /dev/null
+++ b/src/tint/lang/msl/type/level_test.cc
@@ -0,0 +1,52 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/msl/type/level.h"
+
+#include <gtest/gtest.h>
+
+#include "src/tint/lang/core/type/f32.h"
+
+namespace tint::msl::type {
+namespace {
+
+TEST(LevelTest, Equals) {
+    const Level a{};
+    const Level b{};
+    const core::type::F32 c{};
+
+    EXPECT_TRUE(a.Equals(b));
+    EXPECT_FALSE(a.Equals(c));
+}
+
+TEST(LevelTest, FriendlyName) {
+    const Level l;
+    EXPECT_EQ(l.FriendlyName(), "msl.level");
+}
+
+}  // namespace
+}  // namespace tint::msl::type
diff --git a/src/tint/lang/msl/writer/printer/BUILD.bazel b/src/tint/lang/msl/writer/printer/BUILD.bazel
index 5cb3a75..d73e980 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.bazel
+++ b/src/tint/lang/msl/writer/printer/BUILD.bazel
@@ -54,6 +54,7 @@
     "//src/tint/lang/msl",
     "//src/tint/lang/msl/intrinsic",
     "//src/tint/lang/msl/ir",
+    "//src/tint/lang/msl/type",
     "//src/tint/utils/containers",
     "//src/tint/utils/diagnostic",
     "//src/tint/utils/generator",
diff --git a/src/tint/lang/msl/writer/printer/BUILD.cmake b/src/tint/lang/msl/writer/printer/BUILD.cmake
index 762826d..def62bf 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/printer/BUILD.cmake
@@ -55,6 +55,7 @@
   tint_lang_msl
   tint_lang_msl_intrinsic
   tint_lang_msl_ir
+  tint_lang_msl_type
   tint_utils_containers
   tint_utils_diagnostic
   tint_utils_generator
diff --git a/src/tint/lang/msl/writer/printer/BUILD.gn b/src/tint/lang/msl/writer/printer/BUILD.gn
index c31c3dc..22f5222 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.gn
+++ b/src/tint/lang/msl/writer/printer/BUILD.gn
@@ -53,6 +53,7 @@
       "${tint_src_dir}/lang/msl",
       "${tint_src_dir}/lang/msl/intrinsic",
       "${tint_src_dir}/lang/msl/ir",
+      "${tint_src_dir}/lang/msl/type",
       "${tint_src_dir}/utils/containers",
       "${tint_src_dir}/utils/diagnostic",
       "${tint_src_dir}/utils/generator",
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index 4906b2e..c57178d 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -91,6 +91,7 @@
 #include "src/tint/lang/msl/ir/builtin_call.h"
 #include "src/tint/lang/msl/ir/member_builtin_call.h"
 #include "src/tint/lang/msl/ir/memory_order.h"
+#include "src/tint/lang/msl/type/level.h"
 #include "src/tint/lang/msl/writer/common/printer_support.h"
 #include "src/tint/utils/containers/map.h"
 #include "src/tint/utils/generator/text_generator.h"
@@ -1128,6 +1129,10 @@
                 TINT_SCOPED_ASSIGNMENT(current_buffer_, &preamble_buffer_);
                 EmitStructType(str);
             },  //
+
+            // MSL builtin types.
+            [&](const msl::type::Level*) { out << "level"; },  //
+
             TINT_ICE_ON_NO_MATCH);
     }
 
diff --git a/src/tint/lang/msl/writer/raise/BUILD.bazel b/src/tint/lang/msl/writer/raise/BUILD.bazel
index 82c8f44..07297b5 100644
--- a/src/tint/lang/msl/writer/raise/BUILD.bazel
+++ b/src/tint/lang/msl/writer/raise/BUILD.bazel
@@ -63,6 +63,7 @@
     "//src/tint/lang/msl",
     "//src/tint/lang/msl/intrinsic",
     "//src/tint/lang/msl/ir",
+    "//src/tint/lang/msl/type",
     "//src/tint/utils/containers",
     "//src/tint/utils/diagnostic",
     "//src/tint/utils/ice",
diff --git a/src/tint/lang/msl/writer/raise/BUILD.cmake b/src/tint/lang/msl/writer/raise/BUILD.cmake
index 44e2501..8067ecb 100644
--- a/src/tint/lang/msl/writer/raise/BUILD.cmake
+++ b/src/tint/lang/msl/writer/raise/BUILD.cmake
@@ -64,6 +64,7 @@
   tint_lang_msl
   tint_lang_msl_intrinsic
   tint_lang_msl_ir
+  tint_lang_msl_type
   tint_utils_containers
   tint_utils_diagnostic
   tint_utils_ice
diff --git a/src/tint/lang/msl/writer/raise/BUILD.gn b/src/tint/lang/msl/writer/raise/BUILD.gn
index 6afcfad..ef4ac3d 100644
--- a/src/tint/lang/msl/writer/raise/BUILD.gn
+++ b/src/tint/lang/msl/writer/raise/BUILD.gn
@@ -66,6 +66,7 @@
       "${tint_src_dir}/lang/msl",
       "${tint_src_dir}/lang/msl/intrinsic",
       "${tint_src_dir}/lang/msl/ir",
+      "${tint_src_dir}/lang/msl/type",
       "${tint_src_dir}/utils/containers",
       "${tint_src_dir}/utils/diagnostic",
       "${tint_src_dir}/utils/ice",
diff --git a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
index 09bd680..b939aba 100644
--- a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
@@ -48,6 +48,7 @@
 #include "src/tint/lang/msl/ir/builtin_call.h"
 #include "src/tint/lang/msl/ir/member_builtin_call.h"
 #include "src/tint/lang/msl/ir/memory_order.h"
+#include "src/tint/lang/msl/type/level.h"
 #include "src/tint/utils/containers/hashmap.h"
 
 namespace tint::msl::writer::raise {
@@ -90,6 +91,7 @@
                     case core::BuiltinFn::kTextureDimensions:
                     case core::BuiltinFn::kTextureLoad:
                     case core::BuiltinFn::kTextureSample:
+                    case core::BuiltinFn::kTextureSampleLevel:
                     case core::BuiltinFn::kTextureStore:
                     case core::BuiltinFn::kStorageBarrier:
                     case core::BuiltinFn::kWorkgroupBarrier:
@@ -151,6 +153,9 @@
                 case core::BuiltinFn::kTextureSample:
                     TextureSample(builtin);
                     break;
+                case core::BuiltinFn::kTextureSampleLevel:
+                    TextureSampleLevel(builtin);
+                    break;
                 case core::BuiltinFn::kTextureStore:
                     TextureStore(builtin);
                     break;
@@ -330,6 +335,30 @@
         builtin->Destroy();
     }
 
+    /// Replace a textureSampleLevel call with the equivalent MSL intrinsic.
+    /// @param builtin the builtin call instruction
+    void TextureSampleLevel(core::ir::CoreBuiltinCall* builtin) {
+        // The MSL intrinsic is a member function, so we split the first argument off as the object.
+        auto* tex = builtin->Args()[0];
+        auto* tex_type = tex->Type()->As<core::type::Texture>();
+        auto args = Vector<core::ir::Value*, 4>(builtin->Args().Offset(1));
+
+        b.InsertBefore(builtin, [&] {
+            // Wrap the LOD argument in a constructor for the MSL `level` builtin type.
+            uint32_t lod_idx = 2;
+            if (tex_type->dim() == core::type::TextureDimension::k2dArray ||
+                tex_type->dim() == core::type::TextureDimension::kCubeArray) {
+                lod_idx = 3;
+            }
+            args[lod_idx] = b.Construct(ty.Get<msl::type::Level>(), args[lod_idx])->Result(0);
+
+            // Call the `sample()` member function.
+            b.MemberCallWithResult<msl::ir::MemberBuiltinCall>(
+                builtin->DetachResult(), msl::BuiltinFn::kSample, tex, std::move(args));
+        });
+        builtin->Destroy();
+    }
+
     /// Replace a textureStore call with the equivalent MSL intrinsic.
     /// @param builtin the builtin call instruction
     void TextureStore(core::ir::CoreBuiltinCall* builtin) {
diff --git a/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc b/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
index a997e2b..82ab856 100644
--- a/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
+++ b/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
@@ -1287,6 +1287,84 @@
     EXPECT_EQ(expect, str());
 }
 
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleLevel) {
+    auto* t = b.FunctionParam(
+        "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2d, ty.f32()));
+    auto* s = b.FunctionParam("s", ty.sampler());
+    auto* coords = b.FunctionParam("coords", ty.vec2<f32>());
+    auto* level = b.FunctionParam("level", ty.f32());
+    auto* func = b.Function("foo", ty.vec4<f32>());
+    func->SetParams({t, s, coords, level});
+    b.Append(func->Block(), [&] {
+        auto* result = b.Call<vec4<f32>>(core::BuiltinFn::kTextureSampleLevel, t, s, coords, level);
+        b.Return(func, result);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %level:f32):vec4<f32> {
+  $B1: {
+    %6:vec4<f32> = textureSampleLevel %t, %s, %coords, %level
+    ret %6
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %level:f32):vec4<f32> {
+  $B1: {
+    %6:msl.level = construct %level
+    %7:vec4<f32> = %t.sample %s, %coords, %6
+    ret %7
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleLevel_Array) {
+    auto* t = b.FunctionParam(
+        "t", ty.Get<core::type::SampledTexture>(core::type::TextureDimension::k2dArray, ty.f32()));
+    auto* s = b.FunctionParam("s", ty.sampler());
+    auto* coords = b.FunctionParam("coords", ty.vec2<f32>());
+    auto* index = b.FunctionParam("index", ty.u32());
+    auto* level = b.FunctionParam("level", ty.f32());
+    auto* func = b.Function("foo", ty.vec4<f32>());
+    func->SetParams({t, s, coords, index, level});
+    b.Append(func->Block(), [&] {
+        auto* result =
+            b.Call<vec4<f32>>(core::BuiltinFn::kTextureSampleLevel, t, s, coords, index, level);
+        b.Return(func, result);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %index:u32, %level:f32):vec4<f32> {
+  $B1: {
+    %7:vec4<f32> = textureSampleLevel %t, %s, %coords, %index, %level
+    ret %7
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %index:u32, %level:f32):vec4<f32> {
+  $B1: {
+    %7:msl.level = construct %level
+    %8:vec4<f32> = %t.sample %s, %coords, %index, %7
+    ret %8
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
 TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_1d_U32Coord) {
     auto format = core::TexelFormat::kRgba8Unorm;
     auto* texture_ty = ty.Get<core::type::StorageTexture>(
diff --git a/test/tint/bug/dawn/947.wgsl.expected.ir.msl b/test/tint/bug/dawn/947.wgsl.expected.ir.msl
index b6b5579..ff29fd4 100644
--- a/test/tint/bug/dawn/947.wgsl.expected.ir.msl
+++ b/test/tint/bug/dawn/947.wgsl.expected.ir.msl
@@ -1,105 +1,72 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct VertexOutputs {
+  float2 texcoords;
+  float4 position;
+};
+struct Uniforms {
+  float2 u_scale;
+  float2 u_offset;
+};
+struct tint_module_vars_struct {
+  const constant Uniforms* uniforms;
+  sampler mySampler;
+  texture2d<float, access::sample> myTexture;
+  thread bool* continue_execution;
+};
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: Uniforms = struct @align(8) {
-  u_scale:vec2<f32> @offset(0)
-  u_offset:vec2<f32> @offset(8)
-}
+struct vs_main_outputs {
+  float2 VertexOutputs_texcoords [[user(locn0)]];
+  float4 VertexOutputs_position [[position]];
+};
+struct fs_main_outputs {
+  float4 tint_symbol [[color(0)]];
+};
+struct fs_main_inputs {
+  float2 texcoord [[user(locn0)]];
+};
 
-VertexOutputs = struct @align(16) {
-  texcoords:vec2<f32> @offset(0), @location(0)
-  position:vec4<f32> @offset(16), @builtin(position)
-}
-
-$B1: {  # root
-  %uniforms:ptr<uniform, Uniforms, read> = var @binding_point(0, 0)
-  %mySampler:ptr<handle, sampler, read> = var @binding_point(0, 1)
-  %myTexture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 2)
-  %continue_execution:ptr<private, bool, read_write> = var, true
-}
-
-%vs_main = @vertex func(%VertexIndex:u32 [@vertex_index]):VertexOutputs {
-  $B2: {
-    %texcoord:ptr<function, array<vec2<f32>, 3>, read_write> = var, array<vec2<f32>, 3>(vec2<f32>(-0.5f, 0.0f), vec2<f32>(1.5f, 0.0f), vec2<f32>(0.5f, 2.0f))
-    %output:ptr<function, VertexOutputs, read_write> = var
-    %9:ptr<function, vec4<f32>, read_write> = access %output, 1u
-    %10:ptr<function, vec2<f32>, read_write> = access %texcoord, %VertexIndex
-    %11:vec2<f32> = load %10
-    %12:vec2<f32> = mul %11, 2.0f
-    %13:vec2<f32> = sub %12, vec2<f32>(1.0f)
-    %14:vec4<f32> = construct %13, 0.0f, 1.0f
-    store %9, %14
-    %15:ptr<uniform, vec2<f32>, read> = access %uniforms, 0u
-    %16:f32 = load_vector_element %15, 1u
-    %17:bool = lt %16, 0.0f
-    %flipY:ptr<function, bool, read_write> = var, %17
-    %19:bool = load %flipY
-    if %19 [t: $B3, f: $B4] {  # if_1
-      $B3: {  # true
-        %20:ptr<function, vec2<f32>, read_write> = access %output, 0u
-        %21:ptr<function, vec2<f32>, read_write> = access %texcoord, %VertexIndex
-        %22:vec2<f32> = load %21
-        %23:ptr<uniform, vec2<f32>, read> = access %uniforms, 0u
-        %24:vec2<f32> = load %23
-        %25:vec2<f32> = mul %22, %24
-        %26:ptr<uniform, vec2<f32>, read> = access %uniforms, 1u
-        %27:vec2<f32> = load %26
-        %28:vec2<f32> = add %25, %27
-        %29:vec2<f32> = mul %28, vec2<f32>(1.0f, -1.0f)
-        %30:vec2<f32> = add %29, vec2<f32>(0.0f, 1.0f)
-        store %20, %30
-        exit_if  # if_1
-      }
-      $B4: {  # false
-        %31:ptr<function, vec2<f32>, read_write> = access %output, 0u
-        %32:ptr<function, vec2<f32>, read_write> = access %texcoord, %VertexIndex
-        %33:vec2<f32> = load %32
-        %34:vec2<f32> = mul %33, vec2<f32>(1.0f, -1.0f)
-        %35:vec2<f32> = add %34, vec2<f32>(0.0f, 1.0f)
-        %36:ptr<uniform, vec2<f32>, read> = access %uniforms, 0u
-        %37:vec2<f32> = load %36
-        %38:vec2<f32> = mul %35, %37
-        %39:ptr<uniform, vec2<f32>, read> = access %uniforms, 1u
-        %40:vec2<f32> = load %39
-        %41:vec2<f32> = add %38, %40
-        store %31, %41
-        exit_if  # if_1
-      }
-    }
-    %42:VertexOutputs = load %output
-    ret %42
+VertexOutputs vs_main_inner(uint VertexIndex, tint_module_vars_struct tint_module_vars) {
+  tint_array<float2, 3> texcoord = tint_array<float2, 3>{float2(-0.5f, 0.0f), float2(1.5f, 0.0f), float2(0.5f, 2.0f)};
+  VertexOutputs output = {};
+  output.position = float4(((texcoord[VertexIndex] * 2.0f) - float2(1.0f)), 0.0f, 1.0f);
+  bool flipY = ((*tint_module_vars.uniforms).u_scale[1u] < 0.0f);
+  if (flipY) {
+    output.texcoords = ((((texcoord[VertexIndex] * (*tint_module_vars.uniforms).u_scale) + (*tint_module_vars.uniforms).u_offset) * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f));
+  } else {
+    output.texcoords = ((((texcoord[VertexIndex] * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f)) * (*tint_module_vars.uniforms).u_scale) + (*tint_module_vars.uniforms).u_offset);
   }
+  return output;
 }
-%fs_main = @fragment func(%texcoord_1:vec2<f32> [@location(0)]):vec4<f32> [@location(0)] {  # %texcoord_1: 'texcoord'
-  $B5: {
-    %45:vec2<f32> = clamp %texcoord_1, vec2<f32>(0.0f), vec2<f32>(1.0f)
-    %clampedTexcoord:ptr<function, vec2<f32>, read_write> = var, %45
-    %47:vec2<f32> = load %clampedTexcoord
-    %48:vec2<bool> = eq %47, %texcoord_1
-    %49:bool = all %48
-    %50:bool = eq %49, false
-    if %50 [t: $B6] {  # if_2
-      $B6: {  # true
-        store %continue_execution, false
-        exit_if  # if_2
-      }
-    }
-    %srcColor:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(0.0f)
-    %52:vec4<f32> = load %srcColor
-    %53:bool = load %continue_execution
-    %54:bool = eq %53, false
-    if %54 [t: $B7] {  # if_3
-      $B7: {  # true
-        terminate_invocation
-      }
-    }
-    ret %52
+float4 fs_main_inner(float2 texcoord, tint_module_vars_struct tint_module_vars) {
+  float2 clampedTexcoord = clamp(texcoord, float2(0.0f), float2(1.0f));
+  if (!(all((clampedTexcoord == texcoord)))) {
+    (*tint_module_vars.continue_execution) = false;
   }
+  float4 srcColor = float4(0.0f);
+  if (!((*tint_module_vars.continue_execution))) {
+    discard_fragment();
+  }
+  return srcColor;
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
+vertex vs_main_outputs vs_main(uint VertexIndex [[vertex_id]], const constant Uniforms* uniforms [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.uniforms=uniforms};
+  VertexOutputs const v = vs_main_inner(VertexIndex, tint_module_vars);
+  return vs_main_outputs{.VertexOutputs_texcoords=v.texcoords, .VertexOutputs_position=v.position};
+}
+fragment fs_main_outputs fs_main(fs_main_inputs inputs [[stage_in]]) {
+  thread bool continue_execution = true;
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.continue_execution=(&continue_execution)};
+  return fs_main_outputs{.tint_symbol=fs_main_inner(inputs.texcoord, tint_module_vars)};
+}
diff --git a/test/tint/bug/tint/942.wgsl.expected.ir.msl b/test/tint/bug/tint/942.wgsl.expected.ir.msl
index fc90c50..54205a4 100644
--- a/test/tint/bug/tint/942.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/942.wgsl.expected.ir.msl
@@ -1,321 +1,164 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct Params {
+  uint filterDim;
+  uint blockDim;
+};
+struct Flip {
+  uint value;
+};
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: Params = struct @align(4) {
-  filterDim:u32 @offset(0)
-  blockDim:u32 @offset(4)
+struct tint_module_vars_struct {
+  sampler samp;
+  const constant Params* params;
+  texture2d<float, access::sample> inputTex;
+  texture2d<float, access::write> outputTex;
+  const constant Flip* flip;
+  threadgroup tint_array<tint_array<float3, 256>, 4>* tile;
+};
+struct tint_symbol_2 {
+  tint_array<tint_array<float3, 256>, 4> tint_symbol_1;
+};
+
+uint tint_div_u32(uint lhs, uint rhs) {
+  return (lhs / select(rhs, 1u, (rhs == 0u)));
 }
-
-Flip = struct @align(4) {
-  value:u32 @offset(0)
-}
-
-$B1: {  # root
-  %samp:ptr<handle, sampler, read> = var @binding_point(0, 0)
-  %params:ptr<uniform, Params, read> = var @binding_point(0, 1)
-  %inputTex:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 1)
-  %outputTex:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
-  %flip:ptr<uniform, Flip, read> = var @binding_point(1, 3)
-  %tile:ptr<workgroup, array<array<vec3<f32>, 256>, 4>, read_write> = var
-}
-
-%tint_symbol = @compute @workgroup_size(64, 1, 1) func(%WorkGroupID:vec3<u32> [@workgroup_id], %LocalInvocationID:vec3<u32> [@local_invocation_id], %tint_local_index:u32 [@local_invocation_index]):void {
-  $B2: {
-    loop [i: $B3, b: $B4, c: $B5] {  # loop_1
-      $B3: {  # initializer
-        next_iteration %tint_local_index  # -> $B4
+void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint tint_local_index, tint_module_vars_struct tint_module_vars) {
+  {
+    uint v = 0u;
+    v = tint_local_index;
+    while(true) {
+      uint const v_1 = v;
+      if ((v_1 >= 1024u)) {
+        break;
       }
-      $B4 (%idx:u32): {  # body
-        %12:bool = gte %idx, 1024u
-        if %12 [t: $B6] {  # if_1
-          $B6: {  # true
-            exit_loop  # loop_1
-          }
-        }
-        %13:u32 = mod %idx, 256u
-        %14:u32 = div %idx, 256u
-        %15:ptr<workgroup, vec3<f32>, read_write> = access %tile, %14, %13
-        store %15, vec3<f32>(0.0f)
-        continue  # -> $B5
+      (*tint_module_vars.tile)[(v_1 / 256u)][(v_1 % 256u)] = float3(0.0f);
+      {
+        v = (v_1 + 64u);
       }
-      $B5: {  # continuing
-        %16:u32 = add %idx, 64u
-        next_iteration %16  # -> $B4
-      }
+      continue;
     }
-    %17:void = msl.threadgroup_barrier 4u
-    %18:ptr<uniform, u32, read> = access %params, 0u
-    %19:u32 = load %18
-    %20:u32 = sub %19, 1u
-    %21:u32 = call %tint_div_u32, %20, 2u
-    %filterOffset:u32 = let %21
-    %24:texture_2d<f32> = load %inputTex
-    %25:vec2<u32> = textureDimensions %24, 0i
-    %dims:vec2<u32> = let %25
-    %27:vec2<u32> = swizzle %WorkGroupID, xy
-    %28:ptr<uniform, u32, read> = access %params, 1u
-    %29:u32 = load %28
-    %30:vec2<u32> = construct %29, 4u
-    %31:vec2<u32> = mul %27, %30
-    %32:vec2<u32> = swizzle %LocalInvocationID, xy
-    %33:vec2<u32> = mul %32, vec2<u32>(4u, 1u)
-    %34:vec2<u32> = add %31, %33
-    %35:vec2<u32> = let %34
-    %36:vec2<u32> = construct %filterOffset, 0u
-    %37:vec2<u32> = sub %35, %36
-    %baseIndex:vec2<u32> = let %37
-    loop [i: $B7, b: $B8, c: $B9] {  # loop_2
-      $B7: {  # initializer
-        %r:ptr<function, u32, read_write> = var, 0u
-        next_iteration  # -> $B8
+  }
+  threadgroup_barrier(mem_flags::mem_threadgroup);
+  uint const filterOffset = tint_div_u32(((*tint_module_vars.params).filterDim - 1u), 2u);
+  uint const v_2 = uint(0);
+  uint const v_3 = tint_module_vars.inputTex.get_width(v_2);
+  uint2 const dims = uint2(v_3, tint_module_vars.inputTex.get_height(v_2));
+  uint2 const v_4 = ((WorkGroupID.xy * uint2((*tint_module_vars.params).blockDim, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u)));
+  uint2 const baseIndex = (v_4 - uint2(filterOffset, 0u));
+  {
+    uint r = 0u;
+    while(true) {
+      if ((r < 4u)) {
+      } else {
+        break;
       }
-      $B8: {  # body
-        %40:u32 = load %r
-        %41:bool = lt %40, 4u
-        if %41 [t: $B10, f: $B11] {  # if_2
-          $B10: {  # true
-            exit_if  # if_2
+      {
+        uint c = 0u;
+        while(true) {
+          if ((c < 4u)) {
+          } else {
+            break;
           }
-          $B11: {  # false
-            exit_loop  # loop_2
+          uint2 loadIndex = (baseIndex + uint2(c, r));
+          if (((*tint_module_vars.flip).value != 0u)) {
+            loadIndex = loadIndex.yx;
           }
+          threadgroup float3* const v_5 = (&(*tint_module_vars.tile)[r][((4u * LocalInvocationID[0u]) + c)]);
+          float2 const v_6 = (float2(loadIndex) + float2(0.25f));
+          float2 const v_7 = (v_6 / float2(dims));
+          (*v_5) = tint_module_vars.inputTex.sample(tint_module_vars.samp, v_7, level(0.0f)).xyz;
+          {
+            c = (c + 1u);
+          }
+          continue;
         }
-        loop [i: $B12, b: $B13, c: $B14] {  # loop_3
-          $B12: {  # initializer
-            %c:ptr<function, u32, read_write> = var, 0u
-            next_iteration  # -> $B13
-          }
-          $B13: {  # body
-            %43:u32 = load %c
-            %44:bool = lt %43, 4u
-            if %44 [t: $B15, f: $B16] {  # if_3
-              $B15: {  # true
-                exit_if  # if_3
-              }
-              $B16: {  # false
-                exit_loop  # loop_3
-              }
-            }
-            %45:u32 = load %c
-            %46:u32 = load %r
-            %47:vec2<u32> = construct %45, %46
-            %48:vec2<u32> = add %baseIndex, %47
-            %loadIndex:ptr<function, vec2<u32>, read_write> = var, %48
-            %50:ptr<uniform, u32, read> = access %flip, 0u
-            %51:u32 = load %50
-            %52:bool = neq %51, 0u
-            if %52 [t: $B17] {  # if_4
-              $B17: {  # true
-                %53:vec2<u32> = load %loadIndex
-                %54:vec2<u32> = swizzle %53, yx
-                store %loadIndex, %54
-                exit_if  # if_4
-              }
-            }
-            %55:u32 = load %r
-            %56:u32 = access %LocalInvocationID, 0u
-            %57:u32 = mul 4u, %56
-            %58:u32 = load %c
-            %59:u32 = add %57, %58
-            %60:ptr<workgroup, vec3<f32>, read_write> = access %tile, %55, %59
-            %61:ptr<workgroup, vec3<f32>, read_write> = let %60
-            %62:texture_2d<f32> = load %inputTex
-            %63:texture_2d<f32> = let %62
-            %64:sampler = load %samp
-            %65:sampler = let %64
-            %66:vec2<u32> = load %loadIndex
-            %67:vec2<f32> = convert %66
-            %68:vec2<f32> = add %67, vec2<f32>(0.25f)
-            %69:vec2<f32> = let %68
-            %70:vec2<f32> = convert %dims
-            %71:vec2<f32> = div %69, %70
-            %72:vec4<f32> = textureSampleLevel %63, %65, %71, 0.0f
-            %73:vec3<f32> = swizzle %72, xyz
-            store %61, %73
-            continue  # -> $B14
-          }
-          $B14: {  # continuing
-            %74:u32 = load %c
-            %75:u32 = add %74, 1u
-            store %c, %75
-            next_iteration  # -> $B13
-          }
-        }
-        continue  # -> $B9
       }
-      $B9: {  # continuing
-        %76:u32 = load %r
-        %77:u32 = add %76, 1u
-        store %r, %77
-        next_iteration  # -> $B8
+      {
+        r = (r + 1u);
       }
+      continue;
     }
-    %78:void = msl.threadgroup_barrier 4u
-    loop [i: $B18, b: $B19, c: $B20] {  # loop_4
-      $B18: {  # initializer
-        %r_1:ptr<function, u32, read_write> = var, 0u  # %r_1: 'r'
-        next_iteration  # -> $B19
+  }
+  threadgroup_barrier(mem_flags::mem_threadgroup);
+  {
+    uint r = 0u;
+    while(true) {
+      if ((r < 4u)) {
+      } else {
+        break;
       }
-      $B19: {  # body
-        %80:u32 = load %r_1
-        %81:bool = lt %80, 4u
-        if %81 [t: $B21, f: $B22] {  # if_5
-          $B21: {  # true
-            exit_if  # if_5
+      {
+        uint c = 0u;
+        while(true) {
+          if ((c < 4u)) {
+          } else {
+            break;
           }
-          $B22: {  # false
-            exit_loop  # loop_4
+          uint2 writeIndex = (baseIndex + uint2(c, r));
+          if (((*tint_module_vars.flip).value != 0u)) {
+            writeIndex = writeIndex.yx;
           }
-        }
-        loop [i: $B23, b: $B24, c: $B25] {  # loop_5
-          $B23: {  # initializer
-            %c_1:ptr<function, u32, read_write> = var, 0u  # %c_1: 'c'
-            next_iteration  # -> $B24
+          uint const center = ((4u * LocalInvocationID[0u]) + c);
+          bool v_8 = false;
+          if ((center >= filterOffset)) {
+            v_8 = (center < (256u - filterOffset));
+          } else {
+            v_8 = false;
           }
-          $B24: {  # body
-            %83:u32 = load %c_1
-            %84:bool = lt %83, 4u
-            if %84 [t: $B26, f: $B27] {  # if_6
-              $B26: {  # true
-                exit_if  # if_6
-              }
-              $B27: {  # false
-                exit_loop  # loop_5
-              }
-            }
-            %85:u32 = load %c_1
-            %86:u32 = load %r_1
-            %87:vec2<u32> = construct %85, %86
-            %88:vec2<u32> = add %baseIndex, %87
-            %writeIndex:ptr<function, vec2<u32>, read_write> = var, %88
-            %90:ptr<uniform, u32, read> = access %flip, 0u
-            %91:u32 = load %90
-            %92:bool = neq %91, 0u
-            if %92 [t: $B28] {  # if_7
-              $B28: {  # true
-                %93:vec2<u32> = load %writeIndex
-                %94:vec2<u32> = swizzle %93, yx
-                store %writeIndex, %94
-                exit_if  # if_7
-              }
-            }
-            %95:u32 = access %LocalInvocationID, 0u
-            %96:u32 = mul 4u, %95
-            %97:u32 = load %c_1
-            %98:u32 = add %96, %97
-            %center:u32 = let %98
-            %100:bool = gte %center, %filterOffset
-            %101:bool = if %100 [t: $B29, f: $B30] {  # if_8
-              $B29: {  # true
-                %102:u32 = sub 256u, %filterOffset
-                %103:bool = lt %center, %102
-                exit_if %103  # if_8
-              }
-              $B30: {  # false
-                exit_if false  # if_8
-              }
-            }
-            %104:bool = if %101 [t: $B31, f: $B32] {  # if_9
-              $B31: {  # true
-                %105:vec2<u32> = load %writeIndex
-                %106:vec2<bool> = lt %105, %dims
-                %107:bool = all %106
-                exit_if %107  # if_9
-              }
-              $B32: {  # false
-                exit_if false  # if_9
-              }
-            }
-            if %104 [t: $B33] {  # if_10
-              $B33: {  # true
-                %acc:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(0.0f)
-                loop [i: $B34, b: $B35, c: $B36] {  # loop_6
-                  $B34: {  # initializer
-                    %f:ptr<function, u32, read_write> = var, 0u
-                    next_iteration  # -> $B35
-                  }
-                  $B35: {  # body
-                    %110:u32 = load %f
-                    %111:ptr<uniform, u32, read> = access %params, 0u
-                    %112:u32 = load %111
-                    %113:bool = lt %110, %112
-                    if %113 [t: $B37, f: $B38] {  # if_11
-                      $B37: {  # true
-                        exit_if  # if_11
-                      }
-                      $B38: {  # false
-                        exit_loop  # loop_6
-                      }
-                    }
-                    %114:u32 = load %f
-                    %115:u32 = add %center, %114
-                    %116:u32 = sub %115, %filterOffset
-                    %i:ptr<function, u32, read_write> = var, %116
-                    %118:vec3<f32> = load %acc
-                    %119:vec3<f32> = let %118
-                    %120:ptr<uniform, u32, read> = access %params, 0u
-                    %121:u32 = load %120
-                    %122:f32 = convert %121
-                    %123:f32 = div 1.0f, %122
-                    %124:u32 = load %r_1
-                    %125:u32 = load %i
-                    %126:ptr<workgroup, vec3<f32>, read_write> = access %tile, %124, %125
-                    %127:vec3<f32> = load %126
-                    %128:vec3<f32> = mul %123, %127
-                    %129:vec3<f32> = add %119, %128
-                    store %acc, %129
-                    continue  # -> $B36
-                  }
-                  $B36: {  # continuing
-                    %130:u32 = load %f
-                    %131:u32 = add %130, 1u
-                    store %f, %131
-                    next_iteration  # -> $B35
-                  }
+          bool v_9 = false;
+          if (v_8) {
+            v_9 = all((writeIndex < dims));
+          } else {
+            v_9 = false;
+          }
+          if (v_9) {
+            float3 acc = float3(0.0f);
+            {
+              uint f = 0u;
+              while(true) {
+                if ((f < (*tint_module_vars.params).filterDim)) {
+                } else {
+                  break;
                 }
-                %132:texture_storage_2d<rgba8unorm, write> = load %outputTex
-                %133:texture_storage_2d<rgba8unorm, write> = let %132
-                %134:vec2<u32> = load %writeIndex
-                %135:vec2<u32> = let %134
-                %136:vec3<f32> = load %acc
-                %137:vec4<f32> = construct %136, 1.0f
-                %138:void = textureStore %133, %135, %137
-                exit_if  # if_10
+                uint i = ((center + f) - filterOffset);
+                float3 const v_10 = acc;
+                float const v_11 = (1.0f / float((*tint_module_vars.params).filterDim));
+                acc = (v_10 + (v_11 * (*tint_module_vars.tile)[r][i]));
+                {
+                  f = (f + 1u);
+                }
+                continue;
               }
             }
-            continue  # -> $B25
+            uint2 const v_12 = writeIndex;
+            tint_module_vars.outputTex.write(float4(acc, 1.0f), v_12);
           }
-          $B25: {  # continuing
-            %139:u32 = load %c_1
-            %140:u32 = add %139, 1u
-            store %c_1, %140
-            next_iteration  # -> $B24
+          {
+            c = (c + 1u);
           }
+          continue;
         }
-        continue  # -> $B20
       }
-      $B20: {  # continuing
-        %141:u32 = load %r_1
-        %142:u32 = add %141, 1u
-        store %r_1, %142
-        next_iteration  # -> $B19
+      {
+        r = (r + 1u);
       }
+      continue;
     }
-    ret
   }
 }
-%tint_div_u32 = func(%lhs:u32, %rhs:u32):u32 {
-  $B39: {
-    %145:bool = eq %rhs, 0u
-    %146:u32 = select %rhs, 1u, %145
-    %147:u32 = div %lhs, %146
-    ret %147
-  }
+kernel void tint_symbol(uint3 WorkGroupID [[threadgroup_position_in_grid]], uint3 LocalInvocationID [[thread_position_in_threadgroup]], uint tint_local_index [[thread_index_in_threadgroup]], sampler samp [[sampler(0)]], const constant Params* params [[buffer(0)]], texture2d<float, access::sample> inputTex [[texture(0)]], texture2d<float, access::write> outputTex [[texture(1)]], const constant Flip* flip [[buffer(1)]], threadgroup tint_symbol_2* v_13 [[threadgroup(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.samp=samp, .params=params, .inputTex=inputTex, .outputTex=outputTex, .flip=flip, .tile=(&(*v_13).tint_symbol_1)};
+  tint_symbol_inner(WorkGroupID, LocalInvocationID, tint_local_index, tint_module_vars);
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
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 7139838..10866d7 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
@@ -1,31 +1,90 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_GammaTransferParams {
+  float G;
+  float A;
+  float B;
+  float C;
+  float D;
+  float E;
+  float F;
+  uint padding;
+};
+struct tint_ExternalTextureParams {
+  uint numPlanes;
+  uint doYuvToRgbConversionOnly;
+  float3x4 yuvToRgbConversionMatrix;
+  tint_GammaTransferParams gammaDecodeParams;
+  tint_GammaTransferParams gammaEncodeParams;
+  float3x3 gamutConversionMatrix;
+  float3x2 sampleTransform;
+  float3x2 loadTransform;
+  float2 samplePlane0RectMin;
+  float2 samplePlane0RectMax;
+  float2 samplePlane1RectMin;
+  float2 samplePlane1RectMax;
+  uint2 visibleSize;
+  float2 plane1CoordFactor;
+};
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0_plane0;
+  texture2d<float, access::sample> arg_0_plane1;
+  const constant tint_ExternalTextureParams* arg_0_params;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-
-@group(1) @binding(0) var arg_0 : texture_external;
-
-@group(1) @binding(1) var arg_1 : sampler;
-
-fn textureSampleBaseClampToEdge_7c04e6() {
-  var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, vec2<f32>(1.0f));
-  prevent_dce = res;
+float3 tint_GammaCorrection(float3 v, tint_GammaTransferParams params) {
+  float3 const v_1 = float3(params.G);
+  float3 const v_2 = float3(params.D);
+  float3 const v_3 = abs(v);
+  float3 const v_4 = sign(v);
+  return select((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E)), (v_4 * ((params.C * v_3) + params.F)), (v_3 < v_2));
 }
-
-@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
-  textureSampleBaseClampToEdge_7c04e6();
-  return vec4<f32>();
+float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler 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));
+    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];
+    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_8 = 1.0f;
+  }
+  float3 const v_12 = v_7;
+  float3 v_13 = 0.0f;
+  if ((params.doYuvToRgbConversionOnly == 0u)) {
+    v_13 = tint_GammaCorrection((params.gamutConversionMatrix * tint_GammaCorrection(v_12, params.gammaDecodeParams)), params.gammaEncodeParams);
+  } else {
+    v_13 = v_12;
+  }
+  return float4(v_13, v_8);
 }
-
-@fragment
-fn fragment_main() {
-  textureSampleBaseClampToEdge_7c04e6();
+void textureSampleBaseClampToEdge_7c04e6(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_TextureSampleExternal(tint_module_vars.arg_0_plane0, tint_module_vars.arg_0_plane1, (*tint_module_vars.arg_0_params), tint_module_vars.arg_1, float2(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-@compute @workgroup_size(1)
-fn compute_main() {
-  textureSampleBaseClampToEdge_7c04e6();
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+  return float4(0.0f);
 }
-
-Failed to generate: error: ExternalTextureOptions missing binding entry for [group: 1, binding: 0]
+fragment void fragment_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
index e63ac89..395fb8c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
@@ -1,53 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleBaseClampToEdge_9ca02c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  float2 const v_1 = (float2(0.5f) / float2(uint2(v, tint_module_vars.arg_0.get_height(0u))));
+  float2 const v_2 = clamp(float2(1.0f), v_1, (float2(1.0f) - v_1));
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v_2, level(0.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleBaseClampToEdge_9ca02c = func():void {
-  $B2: {
-    %5:texture_2d<f32> = load %arg_0
-    %6:texture_2d<f32> = let %5
-    %7:sampler = load %arg_1
-    %8:sampler = let %7
-    %9:vec2<u32> = textureDimensions %6
-    %10:vec2<f32> = convert %9
-    %11:vec2<f32> = div vec2<f32>(0.5f), %10
-    %12:vec2<f32> = let %11
-    %13:vec2<f32> = sub vec2<f32>(1.0f), %12
-    %14:vec2<f32> = clamp vec2<f32>(1.0f), %12, %13
-    %15:vec4<f32> = textureSampleLevel %6, %8, %14, 0.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %15
-    %17:vec4<f32> = load %res
-    store %prevent_dce, %17
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %19:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %21:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %23:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.ir.msl
index 5fa56cf..f5edc65 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_02be59(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_02be59 = func():void {
-  $B2: {
-    %5:texture_depth_2d = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_02be59(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_02be59
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_02be59(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_02be59
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_02be59(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_02be59
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
index f6678dd..55bed74 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_0b0a1b(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1.0f), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_0b0a1b = func():void {
-  $B2: {
-    %5:texture_2d<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_0b0a1b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_0b0a1b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0b0a1b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_0b0a1b
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0b0a1b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_0b0a1b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
index 05d280a..4e7da23 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_0bdd9a(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1, level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_0bdd9a = func():void {
-  $B2: {
-    %5:texture_cube_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1i, 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_0bdd9a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_0bdd9a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0bdd9a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_0bdd9a
-    ret
-  }
+kernel void compute_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0bdd9a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_0bdd9a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.ir.msl
index 5d2dcc9..767f8dc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_1b0291(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_1b0291 = func():void {
-  $B2: {
-    %5:texture_depth_cube = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_1b0291(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_1b0291
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1b0291(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_1b0291
-    ret
-  }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1b0291(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_1b0291
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
index 4186450..70e20d2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_1bf73e(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_1bf73e = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_1bf73e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_1bf73e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1bf73e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_1bf73e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1bf73e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_1bf73e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.ir.msl
index fed51d5..0e98f45 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_265cc7(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_265cc7 = func():void {
-  $B2: {
-    %5:texture_2d_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_265cc7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_265cc7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_265cc7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_265cc7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_265cc7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_265cc7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.ir.msl
index 05b9d3e..25b07c4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_2974eb(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_2974eb = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_2974eb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_2974eb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_2974eb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_2974eb
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_2974eb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_2974eb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.ir.msl
index db2c003..bb4f159 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_302be4(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_302be4 = func():void {
-  $B2: {
-    %5:texture_2d_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_302be4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_302be4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_302be4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_302be4
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_302be4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_302be4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.ir.msl
index a80c7e1..4c738bc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_36780e(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_36780e = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1i, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_36780e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_36780e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36780e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_36780e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36780e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_36780e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
index 47c29e3..5aacf33 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_36f0d3(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1u), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_36f0d3 = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1u, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_36f0d3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_36f0d3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36f0d3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_36f0d3
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36f0d3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_36f0d3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.ir.msl
index a04d36c..ec3a544 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_3c3442(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_3c3442 = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_3c3442(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_3c3442
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_3c3442(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_3c3442
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_3c3442(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_3c3442
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.ir.msl
index af54a08..1adaab9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_615583(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_615583 = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_615583(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_615583
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_615583(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_615583
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_615583(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_615583
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.ir.msl
index 8be7331..027af86 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_73e892(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_73e892 = func():void {
-  $B2: {
-    %5:texture_depth_2d = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_73e892(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_73e892
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_73e892(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_73e892
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_73e892(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_73e892
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.ir.msl
index e19ee04..4cc6b03 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_749baf(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_749baf = func():void {
-  $B2: {
-    %5:texture_depth_2d = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_749baf(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_749baf
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_749baf(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_749baf
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_749baf(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_749baf
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.ir.msl
index 178f030..903684e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_941a53(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1u, level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_941a53 = func():void {
-  $B2: {
-    %5:texture_depth_cube_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1u, 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_941a53(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_941a53
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_941a53(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_941a53
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_941a53(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_941a53
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.ir.msl
index e4604cc..7743a9c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_a12142(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1, level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_a12142 = func():void {
-  $B2: {
-    %5:texture_depth_cube_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1i, 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_a12142(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_a12142
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_a12142(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_a12142
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_a12142(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_a12142
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
index ab114e6..ee92ff0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_aab3b9(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1u, level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_aab3b9 = func():void {
-  $B2: {
-    %5:texture_cube_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1u, 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_aab3b9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_aab3b9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_aab3b9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_aab3b9
-    ret
-  }
+kernel void compute_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_aab3b9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_aab3b9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
index adc28a7..ca83384 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_3d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_abfcc0(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_abfcc0 = func():void {
-  $B2: {
-    %5:texture_3d<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_abfcc0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_abfcc0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_abfcc0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_abfcc0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_abfcc0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_abfcc0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
index 6823dba..d141b60 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ae5e39(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1, level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ae5e39 = func():void {
-  $B2: {
-    %5:texture_depth_cube_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1i, 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ae5e39(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_ae5e39
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae5e39(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_ae5e39
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae5e39(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_ae5e39
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
index 3d0c2f4..92ef72f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ae92a2(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), level(1u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ae92a2 = func():void {
-  $B2: {
-    %5:texture_depth_cube = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1u
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ae92a2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_ae92a2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae92a2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_ae92a2
-    ret
-  }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae92a2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_ae92a2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
index 6bcddb2..264c19a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_b7c55c(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1, level(1.0f), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_b7c55c = func():void {
-  $B2: {
-    %5:texture_2d_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_b7c55c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_b7c55c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_b7c55c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_b7c55c
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_b7c55c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_b7c55c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.ir.msl
index 80c8b4a..d9a07db 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_c32df7(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_c32df7 = func():void {
-  $B2: {
-    %5:texture_cube<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_c32df7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_c32df7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c32df7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_c32df7
-    ret
-  }
+kernel void compute_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c32df7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_c32df7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
index d7f8271..80af6d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_c6aca6(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_c6aca6 = func():void {
-  $B2: {
-    %5:texture_2d<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_c6aca6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_c6aca6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c6aca6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_c6aca6
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c6aca6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_c6aca6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
index 076b1c9..3606d61 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_cdfe0f(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1u), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_cdfe0f = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1u, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_cdfe0f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_cdfe0f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_cdfe0f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_cdfe0f
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_cdfe0f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_cdfe0f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
index b903fa9..e132cc5 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_3d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_dcbecb(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), level(1.0f), int3(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_dcbecb = func():void {
-  $B2: {
-    %5:texture_3d<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1.0f, vec3<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_dcbecb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_dcbecb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_dcbecb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_dcbecb
-    ret
-  }
+kernel void compute_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_dcbecb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_dcbecb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
index 75bfa63..300795b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_e6ce9e(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_e6ce9e = func():void {
-  $B2: {
-    %5:texture_depth_2d_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1i, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_e6ce9e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_e6ce9e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_e6ce9e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_e6ce9e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_e6ce9e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_e6ce9e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
index a14e215..89a1020 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_f3b2c8(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), level(1u), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_f3b2c8 = func():void {
-  $B2: {
-    %5:texture_depth_2d = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_f3b2c8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_f3b2c8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_f3b2c8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_f3b2c8
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_f3b2c8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_f3b2c8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
index ccecf6f..a1dcce3 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_faa6d7(tint_module_vars_struct tint_module_vars) {
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float2(1.0f), 1u, level(1.0f), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_faa6d7 = func():void {
-  $B2: {
-    %5:texture_2d_array<f32> = load %arg_0
-    %6:sampler = load %arg_1
-    %7:vec4<f32> = textureSampleLevel %5, %6, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %7
-    %9:vec4<f32> = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_faa6d7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_faa6d7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_faa6d7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_faa6d7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_faa6d7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_faa6d7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
index b6b1184..692f98b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
@@ -1,45 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ff11bc(tint_module_vars_struct tint_module_vars) {
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, float3(1.0f), 1u, level(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ff11bc = func():void {
-  $B2: {
-    %5:texture_depth_cube_array = load %arg_0
-    %6:sampler = load %arg_1
-    %7:f32 = textureSampleLevel %5, %6, vec3<f32>(1.0f), 1u, 1i
-    %res:ptr<function, f32, read_write> = var, %7
-    %9:f32 = load %res
-    store %prevent_dce, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ff11bc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %11:void = call %textureSampleLevel_ff11bc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ff11bc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %13:void = call %textureSampleLevel_ff11bc
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ff11bc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %15:void = call %textureSampleLevel_ff11bc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
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 2cba1d7..017f424 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
@@ -1,32 +1,91 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_GammaTransferParams {
+  float G;
+  float A;
+  float B;
+  float C;
+  float D;
+  float E;
+  float F;
+  uint padding;
+};
+struct tint_ExternalTextureParams {
+  uint numPlanes;
+  uint doYuvToRgbConversionOnly;
+  float3x4 yuvToRgbConversionMatrix;
+  tint_GammaTransferParams gammaDecodeParams;
+  tint_GammaTransferParams gammaEncodeParams;
+  float3x3 gamutConversionMatrix;
+  float3x2 sampleTransform;
+  float3x2 loadTransform;
+  float2 samplePlane0RectMin;
+  float2 samplePlane0RectMax;
+  float2 samplePlane1RectMin;
+  float2 samplePlane1RectMax;
+  uint2 visibleSize;
+  float2 plane1CoordFactor;
+};
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0_plane0;
+  texture2d<float, access::sample> arg_0_plane1;
+  const constant tint_ExternalTextureParams* arg_0_params;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-
-@group(1) @binding(0) var arg_0 : texture_external;
-
-@group(1) @binding(1) var arg_1 : sampler;
-
-fn textureSampleBaseClampToEdge_7c04e6() {
-  var arg_2 = vec2<f32>(1.0f);
-  var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
-  prevent_dce = res;
+float3 tint_GammaCorrection(float3 v, tint_GammaTransferParams params) {
+  float3 const v_1 = float3(params.G);
+  float3 const v_2 = float3(params.D);
+  float3 const v_3 = abs(v);
+  float3 const v_4 = sign(v);
+  return select((v_4 * (pow(((params.A * v_3) + params.B), v_1) + params.E)), (v_4 * ((params.C * v_3) + params.F)), (v_3 < v_2));
 }
-
-@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
-  textureSampleBaseClampToEdge_7c04e6();
-  return vec4<f32>();
+float4 tint_TextureSampleExternal(texture2d<float, access::sample> plane_0, texture2d<float, access::sample> plane_1, tint_ExternalTextureParams params, sampler 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));
+    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];
+    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_8 = 1.0f;
+  }
+  float3 const v_12 = v_7;
+  float3 v_13 = 0.0f;
+  if ((params.doYuvToRgbConversionOnly == 0u)) {
+    v_13 = tint_GammaCorrection((params.gamutConversionMatrix * tint_GammaCorrection(v_12, params.gammaDecodeParams)), params.gammaEncodeParams);
+  } else {
+    v_13 = v_12;
+  }
+  return float4(v_13, v_8);
 }
-
-@fragment
-fn fragment_main() {
-  textureSampleBaseClampToEdge_7c04e6();
+void textureSampleBaseClampToEdge_7c04e6(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  float4 res = tint_TextureSampleExternal(tint_module_vars.arg_0_plane0, tint_module_vars.arg_0_plane1, (*tint_module_vars.arg_0_params), tint_module_vars.arg_1, arg_2);
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-@compute @workgroup_size(1)
-fn compute_main() {
-  textureSampleBaseClampToEdge_7c04e6();
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+  return float4(0.0f);
 }
-
-Failed to generate: error: ExternalTextureOptions missing binding entry for [group: 1, binding: 0]
+fragment void fragment_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_7c04e6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0_plane0 [[texture(0)]], texture2d<float, access::sample> arg_0_plane1 [[texture(1)]], const constant tint_ExternalTextureParams* arg_0_params [[buffer(2)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0_plane0=arg_0_plane0, .arg_0_plane1=arg_0_plane1, .arg_0_params=arg_0_params, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
index d3c8c2f..1401021 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.ir.msl
@@ -1,56 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleBaseClampToEdge_9ca02c(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  float2 const v = arg_2;
+  uint const v_1 = tint_module_vars.arg_0.get_width(0u);
+  float2 const v_2 = (float2(0.5f) / float2(uint2(v_1, tint_module_vars.arg_0.get_height(0u))));
+  float2 const v_3 = clamp(v, v_2, (float2(1.0f) - v_2));
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v_3, level(0.0f));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleBaseClampToEdge_9ca02c = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %6:texture_2d<f32> = load %arg_0
-    %7:texture_2d<f32> = let %6
-    %8:sampler = load %arg_1
-    %9:sampler = let %8
-    %10:vec2<f32> = load %arg_2
-    %11:vec2<f32> = let %10
-    %12:vec2<u32> = textureDimensions %7
-    %13:vec2<f32> = convert %12
-    %14:vec2<f32> = div vec2<f32>(0.5f), %13
-    %15:vec2<f32> = let %14
-    %16:vec2<f32> = sub vec2<f32>(1.0f), %15
-    %17:vec2<f32> = clamp %11, %15, %16
-    %18:vec4<f32> = textureSampleLevel %7, %9, %17, 0.0f
-    %res:ptr<function, vec4<f32>, read_write> = var, %18
-    %20:vec4<f32> = load %res
-    store %prevent_dce, %20
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %22:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %24:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleBaseClampToEdge_9ca02c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %26:void = call %textureSampleBaseClampToEdge_9ca02c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.ir.msl
index f636a1e..4604a07 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_02be59(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  float2 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_02be59 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %7:texture_depth_2d = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:i32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_02be59(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_02be59
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_02be59(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_02be59
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_02be59(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_02be59
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
index 93c08bb..5c3d1a5 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_0b0a1b(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  float arg_3 = 1.0f;
+  float2 const v = arg_2;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_0b0a1b = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, f32, read_write> = var, 1.0f
-    %7:texture_2d<f32> = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:f32 = load %arg_3
-    %11:vec4<f32> = textureSampleLevel %7, %8, %9, %10, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %11
-    %13:vec4<f32> = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_0b0a1b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_0b0a1b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0b0a1b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_0b0a1b
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0b0a1b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_0b0a1b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
index 26e7592..9600e2a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_0bdd9a(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  int arg_3 = 1;
+  float arg_4 = 1.0f;
+  float3 const v = arg_2;
+  int const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_0bdd9a = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_cube_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_0bdd9a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_0bdd9a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0bdd9a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_0bdd9a
-    ret
-  }
+kernel void compute_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_0bdd9a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_0bdd9a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.ir.msl
index 493a608..d21b7ed 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_1b0291(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  int arg_3 = 1;
+  float3 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_1b0291 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %7:texture_depth_cube = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec3<f32> = load %arg_2
-    %10:i32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_1b0291(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_1b0291
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1b0291(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_1b0291
-    ret
-  }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1b0291(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_1b0291
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
index ff9ed6a..bf05340 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_1bf73e(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  int arg_4 = 1;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_1bf73e = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_1bf73e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_1bf73e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1bf73e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_1bf73e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_1bf73e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_1bf73e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.ir.msl
index ffe7d11..e65e196 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_265cc7(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  float arg_4 = 1.0f;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_265cc7 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_2d_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_265cc7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_265cc7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_265cc7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_265cc7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_265cc7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_265cc7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.ir.msl
index a00c0ab..85cc518 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_2974eb(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  uint arg_4 = 1u;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_2974eb = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_2974eb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_2974eb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_2974eb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_2974eb
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_2974eb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_2974eb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.ir.msl
index aa7c693..0f59fa0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_302be4(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  float arg_4 = 1.0f;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_302be4 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_2d_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_302be4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_302be4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_302be4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_302be4
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_302be4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_302be4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.ir.msl
index b277f87..b99f09e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_36780e(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  int arg_4 = 1;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_36780e = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_36780e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_36780e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36780e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_36780e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36780e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_36780e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
index 0767259..ab0ae6a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_36f0d3(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  uint arg_4 = 1u;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_36f0d3 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_36f0d3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_36f0d3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36f0d3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_36f0d3
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_36f0d3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_36f0d3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.ir.msl
index a36a9f6..8f80c66 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_3c3442(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  int arg_4 = 1;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_3c3442 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_3c3442(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_3c3442
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_3c3442(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_3c3442
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_3c3442(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_3c3442
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.ir.msl
index 18e6868..67e7dcb 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_615583(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  uint arg_4 = 1u;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_615583 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_615583(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_615583
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_615583(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_615583
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_615583(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_615583
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.ir.msl
index 0768be4..3c46df2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_73e892(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  float2 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_73e892 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %7:texture_depth_2d = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:u32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_73e892(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_73e892
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_73e892(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_73e892
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_73e892(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_73e892
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.ir.msl
index c6ea513..79b77ec 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_749baf(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  float2 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_749baf = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %7:texture_depth_2d = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:i32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_749baf(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_749baf
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_749baf(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_749baf
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_749baf(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_749baf
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.ir.msl
index 1646df6..d53b69a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_941a53(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  uint arg_3 = 1u;
+  uint arg_4 = 1u;
+  float3 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_941a53 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_cube_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_941a53(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_941a53
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_941a53(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_941a53
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_941a53(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_941a53
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.ir.msl
index f5fac29..8f12c21 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_a12142(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  int arg_3 = 1;
+  uint arg_4 = 1u;
+  float3 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_a12142 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_cube_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_a12142(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_a12142
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_a12142(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_a12142
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_a12142(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_a12142
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
index c9fa989..cb6f532 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_aab3b9(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  uint arg_3 = 1u;
+  float arg_4 = 1.0f;
+  float3 const v = arg_2;
+  uint const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_aab3b9 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_cube_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_aab3b9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_aab3b9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_aab3b9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_aab3b9
-    ret
-  }
+kernel void compute_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_aab3b9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_aab3b9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
index 794ad6f..c26d79e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_3d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_abfcc0(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  float arg_3 = 1.0f;
+  float3 const v = arg_2;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_abfcc0 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, f32, read_write> = var, 1.0f
-    %7:texture_3d<f32> = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec3<f32> = load %arg_2
-    %10:f32 = load %arg_3
-    %11:vec4<f32> = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, vec4<f32>, read_write> = var, %11
-    %13:vec4<f32> = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_abfcc0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_abfcc0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_abfcc0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_abfcc0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_abfcc0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_abfcc0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
index db5749f..30ee5d6e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ae5e39(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  int arg_3 = 1;
+  int arg_4 = 1;
+  float3 const v = arg_2;
+  int const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ae5e39 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_cube_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ae5e39(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_ae5e39
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae5e39(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_ae5e39
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae5e39(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_ae5e39
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
index fee4a3e..0d1fd46 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ae92a2(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  uint arg_3 = 1u;
+  float3 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ae92a2 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %7:texture_depth_cube = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec3<f32> = load %arg_2
-    %10:u32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ae92a2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_ae92a2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae92a2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_ae92a2
-    ret
-  }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ae92a2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_ae92a2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
index 7d18dc0..587e035 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_b7c55c(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  int arg_3 = 1;
+  float arg_4 = 1.0f;
+  float2 const v = arg_2;
+  int const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_b7c55c = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, i32, read_write> = var, 1i
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_2d_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:i32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_b7c55c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_b7c55c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_b7c55c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_b7c55c
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_b7c55c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_b7c55c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.ir.msl
index c0418b3..d9b9d70 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texturecube<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_cube<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_c32df7(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  float arg_3 = 1.0f;
+  float3 const v = arg_2;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_c32df7 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, f32, read_write> = var, 1.0f
-    %7:texture_cube<f32> = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec3<f32> = load %arg_2
-    %10:f32 = load %arg_3
-    %11:vec4<f32> = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, vec4<f32>, read_write> = var, %11
-    %13:vec4<f32> = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_c32df7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_c32df7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c32df7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_c32df7
-    ret
-  }
+kernel void compute_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c32df7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_c32df7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texturecube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
index ad808bc..1aee685 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_c6aca6(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  float arg_3 = 1.0f;
+  float2 const v = arg_2;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_c6aca6 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, f32, read_write> = var, 1.0f
-    %7:texture_2d<f32> = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:f32 = load %arg_3
-    %11:vec4<f32> = textureSampleLevel %7, %8, %9, %10
-    %res:ptr<function, vec4<f32>, read_write> = var, %11
-    %13:vec4<f32> = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_c6aca6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_c6aca6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c6aca6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_c6aca6
-    ret
-  }
+kernel void compute_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_c6aca6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_c6aca6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
index bf7cc92..c5bcfb8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_cdfe0f(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  uint arg_4 = 1u;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_cdfe0f = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, u32, read_write> = var, 1u
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:u32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_cdfe0f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_cdfe0f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_cdfe0f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_cdfe0f
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_cdfe0f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_cdfe0f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
index d8ab40c..23ea6c1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_3d<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_dcbecb(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  float arg_3 = 1.0f;
+  float3 const v = arg_2;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3), int3(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_dcbecb = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, f32, read_write> = var, 1.0f
-    %7:texture_3d<f32> = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec3<f32> = load %arg_2
-    %10:f32 = load %arg_3
-    %11:vec4<f32> = textureSampleLevel %7, %8, %9, %10, vec3<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %11
-    %13:vec4<f32> = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_dcbecb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_dcbecb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_dcbecb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_dcbecb
-    ret
-  }
+kernel void compute_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_dcbecb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_dcbecb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
index 6dfcba4..0f48177 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_e6ce9e(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  int arg_4 = 1;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_e6ce9e = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_2d_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_e6ce9e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_e6ce9e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_e6ce9e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_e6ce9e
-    ret
-  }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_e6ce9e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_e6ce9e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
index 4f84a49..f34834a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.ir.msl
@@ -1,49 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depth2d<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_f3b2c8(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  float2 const v = arg_2;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_f3b2c8 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %7:texture_depth_2d = load %arg_0
-    %8:sampler = load %arg_1
-    %9:vec2<f32> = load %arg_2
-    %10:u32 = load %arg_3
-    %11:f32 = textureSampleLevel %7, %8, %9, %10, vec2<i32>(1i)
-    %res:ptr<function, f32, read_write> = var, %11
-    %13:f32 = load %res
-    store %prevent_dce, %13
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_f3b2c8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %15:void = call %textureSampleLevel_f3b2c8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_f3b2c8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %17:void = call %textureSampleLevel_f3b2c8
-    ret
-  }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_f3b2c8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %19:void = call %textureSampleLevel_f3b2c8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
index 0a6daf2..f8cfad9 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float4* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, vec4<f32>, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_faa6d7(tint_module_vars_struct tint_module_vars) {
+  float2 arg_2 = float2(1.0f);
+  uint arg_3 = 1u;
+  float arg_4 = 1.0f;
+  float2 const v = arg_2;
+  uint const v_1 = arg_3;
+  float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4), int2(1));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_faa6d7 = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, f32, read_write> = var, 1.0f
-    %8:texture_2d_array<f32> = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec2<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:f32 = load %arg_4
-    %13:vec4<f32> = textureSampleLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
-    %res:ptr<function, vec4<f32>, read_write> = var, %13
-    %15:vec4<f32> = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_faa6d7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_faa6d7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_faa6d7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_faa6d7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_faa6d7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_faa6d7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
index 548ac4e..ea126e8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.ir.msl
@@ -1,51 +1,36 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  depthcube_array<float, access::sample> arg_0;
+  sampler arg_1;
+  device float* prevent_dce;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
-  %arg_1:ptr<handle, sampler, read> = var @binding_point(1, 1)
-  %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+void textureSampleLevel_ff11bc(tint_module_vars_struct tint_module_vars) {
+  float3 arg_2 = float3(1.0f);
+  uint arg_3 = 1u;
+  int arg_4 = 1;
+  float3 const v = arg_2;
+  uint const v_1 = arg_3;
+  float res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, v_1, level(arg_4));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureSampleLevel_ff11bc = func():void {
-  $B2: {
-    %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
-    %arg_3:ptr<function, u32, read_write> = var, 1u
-    %arg_4:ptr<function, i32, read_write> = var, 1i
-    %8:texture_depth_cube_array = load %arg_0
-    %9:sampler = load %arg_1
-    %10:vec3<f32> = load %arg_2
-    %11:u32 = load %arg_3
-    %12:i32 = load %arg_4
-    %13:f32 = textureSampleLevel %8, %9, %10, %11, %12
-    %res:ptr<function, f32, read_write> = var, %13
-    %15:f32 = load %res
-    store %prevent_dce, %15
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureSampleLevel_ff11bc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %17:void = call %textureSampleLevel_ff11bc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ff11bc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %19:void = call %textureSampleLevel_ff11bc
-    ret
-  }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  textureSampleLevel_ff11bc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %21:void = call %textureSampleLevel_ff11bc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-unhandled variable address space
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_DepthTexture_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleExplicitLod_UsingLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleProjExplicitLod_Lod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/PreserveFloatCoords_Arrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/PreserveFloatCoords_Arrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/PreserveFloatCoords_Arrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/PreserveFloatCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_3.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/PreserveFloatCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_3.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/PreserveFloatCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_3.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_3.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_3.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_3.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm.expected.ir.msl
deleted file mode 100644
index d62b699..0000000
--- a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleLevel
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************