[msl] Add polyfill for textureStore()

Insert a fence after texture writes to read-write storage textures to
ensure correct memory ordering.

Add MSL member function definitions for `write()` and `fence()`.

Bug: 42251016
Change-Id: I59436da345e7940c1f4d898c8fb646ad1c559c7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/192944
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/msl/builtin_fn.cc b/src/tint/lang/msl/builtin_fn.cc
index 652560d..1eedd33 100644
--- a/src/tint/lang/msl/builtin_fn.cc
+++ b/src/tint/lang/msl/builtin_fn.cc
@@ -64,6 +64,8 @@
             return "atomic_load_explicit";
         case BuiltinFn::kAtomicStoreExplicit:
             return "atomic_store_explicit";
+        case BuiltinFn::kFence:
+            return "fence";
         case BuiltinFn::kGetWidth:
             return "get_width";
         case BuiltinFn::kGetHeight:
@@ -74,6 +76,8 @@
             return "read";
         case BuiltinFn::kSample:
             return "sample";
+        case BuiltinFn::kWrite:
+            return "write";
         case BuiltinFn::kThreadgroupBarrier:
             return "threadgroup_barrier";
     }
diff --git a/src/tint/lang/msl/builtin_fn.h b/src/tint/lang/msl/builtin_fn.h
index 866a290..d1665b4 100644
--- a/src/tint/lang/msl/builtin_fn.h
+++ b/src/tint/lang/msl/builtin_fn.h
@@ -58,11 +58,13 @@
     kAtomicFetchXorExplicit,
     kAtomicLoadExplicit,
     kAtomicStoreExplicit,
+    kFence,
     kGetWidth,
     kGetHeight,
     kGetDepth,
     kRead,
     kSample,
+    kWrite,
     kThreadgroupBarrier,
     kNone,
 };
diff --git a/src/tint/lang/msl/intrinsic/data.cc b/src/tint/lang/msl/intrinsic/data.cc
index a663ca2..6b7dd8d 100644
--- a/src/tint/lang/msl/intrinsic/data.cc
+++ b/src/tint/lang/msl/intrinsic/data.cc
@@ -636,6 +636,22 @@
   }
 };
 
+/// EnumMatcher for 'match writable'
+constexpr NumberMatcher kWritableMatcher {
+/* match */ [](MatchState&, Number number) -> Number {
+    switch (static_cast<core::Access>(number.Value())) {
+      case core::Access::kWrite:
+      case core::Access::kReadWrite:
+        return number;
+      default:
+        return Number::invalid;
+    }
+  },
+/* print */ [](MatchState*, StyledText& out) {
+  out<< style::Enum("write")<< style::Plain(" or ") << style::Enum("read_write");
+  }
+};
+
 /// EnumMatcher for 'match function'
 constexpr NumberMatcher kFunctionMatcher {
 /* match */ [](MatchState&, Number number) -> Number {
@@ -769,11 +785,12 @@
   /* [2] */ TemplateNumberMatcher<2>::matcher,
   /* [3] */ kReadWriteMatcher,
   /* [4] */ kReadableMatcher,
-  /* [5] */ kFunctionMatcher,
-  /* [6] */ kWorkgroupOrStorageMatcher,
-  /* [7] */ kF32TexelFormatMatcher,
-  /* [8] */ kI32TexelFormatMatcher,
-  /* [9] */ kU32TexelFormatMatcher,
+  /* [5] */ kWritableMatcher,
+  /* [6] */ kFunctionMatcher,
+  /* [7] */ kWorkgroupOrStorageMatcher,
+  /* [8] */ kF32TexelFormatMatcher,
+  /* [9] */ kI32TexelFormatMatcher,
+  /* [10] */ kU32TexelFormatMatcher,
 };
 
 constexpr MatcherIndex kMatcherIndices[] = {
@@ -783,7 +800,7 @@
   /* [3] */ MatcherIndex(0),
   /* [4] */ MatcherIndex(3),
   /* [5] */ MatcherIndex(11),
-  /* [6] */ MatcherIndex(5),
+  /* [6] */ MatcherIndex(6),
   /* [7] */ MatcherIndex(0),
   /* [8] */ MatcherIndex(3),
   /* [9] */ MatcherIndex(25),
@@ -799,90 +816,124 @@
   /* [19] */ MatcherIndex(0),
   /* [20] */ MatcherIndex(1),
   /* [21] */ MatcherIndex(25),
-  /* [22] */ MatcherIndex(7),
+  /* [22] */ MatcherIndex(8),
   /* [23] */ MatcherIndex(4),
   /* [24] */ MatcherIndex(26),
-  /* [25] */ MatcherIndex(7),
+  /* [25] */ MatcherIndex(8),
   /* [26] */ MatcherIndex(4),
   /* [27] */ MatcherIndex(27),
-  /* [28] */ MatcherIndex(7),
+  /* [28] */ MatcherIndex(8),
   /* [29] */ MatcherIndex(4),
   /* [30] */ MatcherIndex(28),
-  /* [31] */ MatcherIndex(7),
+  /* [31] */ MatcherIndex(8),
   /* [32] */ MatcherIndex(4),
   /* [33] */ MatcherIndex(25),
-  /* [34] */ MatcherIndex(8),
+  /* [34] */ MatcherIndex(9),
   /* [35] */ MatcherIndex(4),
   /* [36] */ MatcherIndex(26),
-  /* [37] */ MatcherIndex(8),
+  /* [37] */ MatcherIndex(9),
   /* [38] */ MatcherIndex(4),
   /* [39] */ MatcherIndex(27),
-  /* [40] */ MatcherIndex(8),
+  /* [40] */ MatcherIndex(9),
   /* [41] */ MatcherIndex(4),
   /* [42] */ MatcherIndex(28),
-  /* [43] */ MatcherIndex(8),
+  /* [43] */ MatcherIndex(9),
   /* [44] */ MatcherIndex(4),
   /* [45] */ MatcherIndex(25),
-  /* [46] */ MatcherIndex(9),
+  /* [46] */ MatcherIndex(10),
   /* [47] */ MatcherIndex(4),
   /* [48] */ MatcherIndex(26),
-  /* [49] */ MatcherIndex(9),
+  /* [49] */ MatcherIndex(10),
   /* [50] */ MatcherIndex(4),
   /* [51] */ MatcherIndex(27),
-  /* [52] */ MatcherIndex(9),
+  /* [52] */ MatcherIndex(10),
   /* [53] */ MatcherIndex(4),
   /* [54] */ MatcherIndex(28),
-  /* [55] */ MatcherIndex(9),
+  /* [55] */ MatcherIndex(10),
   /* [56] */ MatcherIndex(4),
-  /* [57] */ MatcherIndex(13),
-  /* [58] */ MatcherIndex(0),
-  /* [59] */ MatcherIndex(14),
-  /* [60] */ MatcherIndex(0),
-  /* [61] */ MatcherIndex(15),
-  /* [62] */ MatcherIndex(0),
-  /* [63] */ MatcherIndex(16),
-  /* [64] */ MatcherIndex(0),
-  /* [65] */ MatcherIndex(17),
-  /* [66] */ MatcherIndex(0),
-  /* [67] */ MatcherIndex(18),
-  /* [68] */ MatcherIndex(0),
-  /* [69] */ MatcherIndex(24),
-  /* [70] */ MatcherIndex(0),
-  /* [71] */ MatcherIndex(9),
-  /* [72] */ MatcherIndex(0),
-  /* [73] */ MatcherIndex(7),
+  /* [57] */ MatcherIndex(25),
+  /* [58] */ MatcherIndex(8),
+  /* [59] */ MatcherIndex(5),
+  /* [60] */ MatcherIndex(26),
+  /* [61] */ MatcherIndex(8),
+  /* [62] */ MatcherIndex(5),
+  /* [63] */ MatcherIndex(27),
+  /* [64] */ MatcherIndex(8),
+  /* [65] */ MatcherIndex(5),
+  /* [66] */ MatcherIndex(28),
+  /* [67] */ MatcherIndex(8),
+  /* [68] */ MatcherIndex(5),
+  /* [69] */ MatcherIndex(25),
+  /* [70] */ MatcherIndex(9),
+  /* [71] */ MatcherIndex(5),
+  /* [72] */ MatcherIndex(26),
+  /* [73] */ MatcherIndex(9),
   /* [74] */ MatcherIndex(5),
-  /* [75] */ MatcherIndex(8),
-  /* [76] */ MatcherIndex(5),
-  /* [77] */ MatcherIndex(9),
-  /* [78] */ MatcherIndex(6),
+  /* [75] */ MatcherIndex(27),
+  /* [76] */ MatcherIndex(9),
+  /* [77] */ MatcherIndex(5),
+  /* [78] */ MatcherIndex(28),
   /* [79] */ MatcherIndex(9),
   /* [80] */ MatcherIndex(5),
-  /* [81] */ MatcherIndex(13),
-  /* [82] */ MatcherIndex(6),
-  /* [83] */ MatcherIndex(14),
-  /* [84] */ MatcherIndex(6),
-  /* [85] */ MatcherIndex(7),
-  /* [86] */ MatcherIndex(6),
-  /* [87] */ MatcherIndex(15),
-  /* [88] */ MatcherIndex(6),
-  /* [89] */ MatcherIndex(16),
-  /* [90] */ MatcherIndex(6),
-  /* [91] */ MatcherIndex(8),
-  /* [92] */ MatcherIndex(6),
-  /* [93] */ MatcherIndex(17),
-  /* [94] */ MatcherIndex(6),
-  /* [95] */ MatcherIndex(18),
-  /* [96] */ MatcherIndex(6),
-  /* [97] */ MatcherIndex(29),
-  /* [98] */ MatcherIndex(30),
-  /* [99] */ MatcherIndex(19),
-  /* [100] */ MatcherIndex(20),
-  /* [101] */ MatcherIndex(21),
-  /* [102] */ MatcherIndex(22),
-  /* [103] */ MatcherIndex(23),
-  /* [104] */ MatcherIndex(2),
-  /* [105] */ MatcherIndex(12),
+  /* [81] */ MatcherIndex(25),
+  /* [82] */ MatcherIndex(10),
+  /* [83] */ MatcherIndex(5),
+  /* [84] */ MatcherIndex(26),
+  /* [85] */ MatcherIndex(10),
+  /* [86] */ MatcherIndex(5),
+  /* [87] */ MatcherIndex(27),
+  /* [88] */ MatcherIndex(10),
+  /* [89] */ MatcherIndex(5),
+  /* [90] */ MatcherIndex(28),
+  /* [91] */ MatcherIndex(10),
+  /* [92] */ MatcherIndex(5),
+  /* [93] */ MatcherIndex(13),
+  /* [94] */ MatcherIndex(0),
+  /* [95] */ MatcherIndex(14),
+  /* [96] */ MatcherIndex(0),
+  /* [97] */ MatcherIndex(15),
+  /* [98] */ MatcherIndex(0),
+  /* [99] */ MatcherIndex(16),
+  /* [100] */ MatcherIndex(0),
+  /* [101] */ MatcherIndex(17),
+  /* [102] */ MatcherIndex(0),
+  /* [103] */ MatcherIndex(18),
+  /* [104] */ MatcherIndex(0),
+  /* [105] */ MatcherIndex(24),
+  /* [106] */ MatcherIndex(0),
+  /* [107] */ MatcherIndex(9),
+  /* [108] */ MatcherIndex(0),
+  /* [109] */ MatcherIndex(7),
+  /* [110] */ MatcherIndex(5),
+  /* [111] */ MatcherIndex(9),
+  /* [112] */ MatcherIndex(6),
+  /* [113] */ MatcherIndex(13),
+  /* [114] */ MatcherIndex(6),
+  /* [115] */ MatcherIndex(14),
+  /* [116] */ MatcherIndex(6),
+  /* [117] */ MatcherIndex(7),
+  /* [118] */ MatcherIndex(6),
+  /* [119] */ MatcherIndex(7),
+  /* [120] */ MatcherIndex(4),
+  /* [121] */ MatcherIndex(15),
+  /* [122] */ MatcherIndex(6),
+  /* [123] */ MatcherIndex(16),
+  /* [124] */ MatcherIndex(6),
+  /* [125] */ MatcherIndex(8),
+  /* [126] */ MatcherIndex(6),
+  /* [127] */ MatcherIndex(17),
+  /* [128] */ MatcherIndex(6),
+  /* [129] */ MatcherIndex(18),
+  /* [130] */ MatcherIndex(6),
+  /* [131] */ MatcherIndex(29),
+  /* [132] */ MatcherIndex(30),
+  /* [133] */ MatcherIndex(19),
+  /* [134] */ MatcherIndex(20),
+  /* [135] */ MatcherIndex(21),
+  /* [136] */ MatcherIndex(22),
+  /* [137] */ MatcherIndex(23),
+  /* [138] */ MatcherIndex(2),
+  /* [139] */ MatcherIndex(12),
 };
 
 static_assert(MatcherIndicesIndex::CanIndex(kMatcherIndices),
@@ -907,27 +958,27 @@
   {
     /* [3] */
     /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [4] */
     /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [5] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(87),
+    /* matcher_indices */ MatcherIndicesIndex(121),
   },
   {
     /* [6] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [7] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(85),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [8] */
@@ -937,22 +988,22 @@
   {
     /* [9] */
     /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(22),
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [10] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(100),
+    /* matcher_indices */ MatcherIndicesIndex(134),
   },
   {
     /* [11] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [12] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(85),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [13] */
@@ -962,17 +1013,17 @@
   {
     /* [14] */
     /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(22),
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [15] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(61),
+    /* matcher_indices */ MatcherIndicesIndex(97),
   },
   {
     /* [16] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [17] */
@@ -982,17 +1033,17 @@
   {
     /* [18] */
     /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(104),
+    /* matcher_indices */ MatcherIndicesIndex(138),
   },
   {
     /* [19] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(100),
+    /* matcher_indices */ MatcherIndicesIndex(134),
   },
   {
     /* [20] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [21] */
@@ -1007,57 +1058,57 @@
   {
     /* [23] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(83),
+    /* matcher_indices */ MatcherIndicesIndex(115),
   },
   {
     /* [24] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [25] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(85),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [26] */
     /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(22),
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [27] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(89),
+    /* matcher_indices */ MatcherIndicesIndex(123),
   },
   {
     /* [28] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [29] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(91),
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [30] */
     /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(34),
+    /* matcher_indices */ MatcherIndicesIndex(22),
   },
   {
     /* [31] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(95),
+    /* matcher_indices */ MatcherIndicesIndex(129),
   },
   {
     /* [32] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [33] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(91),
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [34] */
@@ -1067,37 +1118,37 @@
   {
     /* [35] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(99),
+    /* matcher_indices */ MatcherIndicesIndex(133),
   },
   {
     /* [36] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [37] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(85),
+    /* matcher_indices */ MatcherIndicesIndex(117),
   },
   {
     /* [38] */
     /* usage */ core::ParameterUsage::kOffset,
-    /* matcher_indices */ MatcherIndicesIndex(22),
+    /* matcher_indices */ MatcherIndicesIndex(119),
   },
   {
     /* [39] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(102),
+    /* matcher_indices */ MatcherIndicesIndex(136),
   },
   {
     /* [40] */
     /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [41] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(91),
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [42] */
@@ -1106,416 +1157,611 @@
   },
   {
     /* [43] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(0),
-  },
-  {
-    /* [44] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(3),
-  },
-  {
-    /* [45] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
-  },
-  {
-    /* [46] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(59),
-  },
-  {
-    /* [47] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
-  },
-  {
-    /* [48] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(1),
-  },
-  {
-    /* [49] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(63),
   },
   {
-    /* [50] */
+    /* [44] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
+  },
+  {
+    /* [45] */
     /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [46] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
+    /* [47] */
+    /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(75),
   },
   {
+    /* [48] */
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
+  },
+  {
+    /* [49] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [50] */
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
+  },
+  {
     /* [51] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(1),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(87),
   },
   {
     /* [52] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(69),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [53] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [54] */
-    /* usage */ core::ParameterUsage::kSampleIndex,
-    /* matcher_indices */ MatcherIndicesIndex(1),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [55] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(99),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(0),
   },
   {
     /* [56] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [57] */
-    /* usage */ core::ParameterUsage::kLevel,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [58] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(103),
+    /* matcher_indices */ MatcherIndicesIndex(95),
   },
   {
     /* [59] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [60] */
-    /* usage */ core::ParameterUsage::kSampleIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [61] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(27),
+    /* matcher_indices */ MatcherIndicesIndex(99),
   },
   {
     /* [62] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
     /* [63] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kLevel,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [64] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(39),
+    /* matcher_indices */ MatcherIndicesIndex(105),
   },
   {
     /* [65] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [66] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
-    /* matcher_indices */ MatcherIndicesIndex(3),
+    /* usage */ core::ParameterUsage::kSampleIndex,
+    /* matcher_indices */ MatcherIndicesIndex(1),
   },
   {
     /* [67] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(51),
+    /* matcher_indices */ MatcherIndicesIndex(133),
   },
   {
     /* [68] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [69] */
-    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* usage */ core::ParameterUsage::kLevel,
     /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [70] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(81),
+    /* matcher_indices */ MatcherIndicesIndex(137),
   },
   {
     /* [71] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [72] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(78),
+    /* usage */ core::ParameterUsage::kSampleIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [73] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(93),
+    /* matcher_indices */ MatcherIndicesIndex(27),
   },
   {
     /* [74] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [75] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(91),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [76] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(101),
+    /* matcher_indices */ MatcherIndicesIndex(39),
   },
   {
     /* [77] */
-    /* usage */ core::ParameterUsage::kSampler,
-    /* matcher_indices */ MatcherIndicesIndex(105),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [78] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(91),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [79] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(0),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(51),
   },
   {
     /* [80] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [81] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(59),
+    /* usage */ core::ParameterUsage::kArrayIndex,
+    /* matcher_indices */ MatcherIndicesIndex(3),
   },
   {
     /* [82] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(113),
   },
   {
     /* [83] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(61),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [84] */
-    /* usage */ core::ParameterUsage::kNone,
+    /* usage */ core::ParameterUsage::kCoords,
     /* matcher_indices */ MatcherIndicesIndex(6),
   },
   {
     /* [85] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(63),
+    /* matcher_indices */ MatcherIndicesIndex(127),
   },
   {
     /* [86] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [87] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(65),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [88] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(135),
   },
   {
     /* [89] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(67),
+    /* usage */ core::ParameterUsage::kSampler,
+    /* matcher_indices */ MatcherIndicesIndex(139),
   },
   {
     /* [90] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(125),
   },
   {
     /* [91] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(99),
+    /* matcher_indices */ MatcherIndicesIndex(57),
   },
   {
     /* [92] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [93] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(100),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [94] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(60),
   },
   {
     /* [95] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(101),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [96] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [97] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(102),
+    /* matcher_indices */ MatcherIndicesIndex(66),
   },
   {
     /* [98] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(111),
   },
   {
     /* [99] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(12),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
     /* [100] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(69),
   },
   {
     /* [101] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(15),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [102] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [103] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(18),
+    /* matcher_indices */ MatcherIndicesIndex(72),
   },
   {
     /* [104] */
-    /* usage */ core::ParameterUsage::kNone,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [105] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(57),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [106] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(78),
   },
   {
     /* [107] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(21),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(34),
   },
   {
     /* [108] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
     /* [109] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(24),
+    /* matcher_indices */ MatcherIndicesIndex(81),
   },
   {
     /* [110] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [111] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(30),
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
     /* [112] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(75),
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(84),
   },
   {
     /* [113] */
-    /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(33),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [114] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
     /* [115] */
     /* usage */ core::ParameterUsage::kTexture,
-    /* matcher_indices */ MatcherIndicesIndex(36),
+    /* matcher_indices */ MatcherIndicesIndex(90),
   },
   {
     /* [116] */
-    /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* usage */ core::ParameterUsage::kValue,
+    /* matcher_indices */ MatcherIndicesIndex(70),
   },
   {
     /* [117] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
+  },
+  {
+    /* [118] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(0),
+  },
+  {
+    /* [119] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [120] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(95),
+  },
+  {
+    /* [121] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [122] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(97),
+  },
+  {
+    /* [123] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [124] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(99),
+  },
+  {
+    /* [125] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [126] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(101),
+  },
+  {
+    /* [127] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [128] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(103),
+  },
+  {
+    /* [129] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [130] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(133),
+  },
+  {
+    /* [131] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [132] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(134),
+  },
+  {
+    /* [133] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [134] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(135),
+  },
+  {
+    /* [135] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [136] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(136),
+  },
+  {
+    /* [137] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [138] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(12),
+  },
+  {
+    /* [139] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [140] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(15),
+  },
+  {
+    /* [141] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [142] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(18),
+  },
+  {
+    /* [143] */
+    /* usage */ core::ParameterUsage::kNone,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [144] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(93),
+  },
+  {
+    /* [145] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [146] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(21),
+  },
+  {
+    /* [147] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [148] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(24),
+  },
+  {
+    /* [149] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [150] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(30),
+  },
+  {
+    /* [151] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(58),
+  },
+  {
+    /* [152] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(33),
+  },
+  {
+    /* [153] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(59),
+  },
+  {
+    /* [154] */
+    /* usage */ core::ParameterUsage::kTexture,
+    /* matcher_indices */ MatcherIndicesIndex(36),
+  },
+  {
+    /* [155] */
+    /* usage */ core::ParameterUsage::kCoords,
+    /* matcher_indices */ MatcherIndicesIndex(109),
+  },
+  {
+    /* [156] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(42),
   },
   {
-    /* [118] */
+    /* [157] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(75),
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
-    /* [119] */
+    /* [158] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(45),
   },
   {
-    /* [120] */
+    /* [159] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(6),
+    /* matcher_indices */ MatcherIndicesIndex(59),
   },
   {
-    /* [121] */
+    /* [160] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(48),
   },
   {
-    /* [122] */
+    /* [161] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(73),
+    /* matcher_indices */ MatcherIndicesIndex(109),
   },
   {
-    /* [123] */
+    /* [162] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(54),
   },
   {
-    /* [124] */
+    /* [163] */
     /* usage */ core::ParameterUsage::kCoords,
-    /* matcher_indices */ MatcherIndicesIndex(75),
+    /* matcher_indices */ MatcherIndicesIndex(58),
   },
   {
-    /* [125] */
+    /* [164] */
     /* usage */ core::ParameterUsage::kTexture,
     /* matcher_indices */ MatcherIndicesIndex(9),
   },
@@ -1528,31 +1774,31 @@
   {
     /* [0] */
     /* name */ "T",
-    /* matcher_indices */ MatcherIndicesIndex(98),
+    /* matcher_indices */ MatcherIndicesIndex(132),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [1] */
     /* name */ "A",
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(131),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [2] */
     /* name */ "L",
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(131),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [3] */
     /* name */ "T",
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(131),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [4] */
     /* name */ "S",
-    /* matcher_indices */ MatcherIndicesIndex(78),
+    /* matcher_indices */ MatcherIndicesIndex(109),
     /* kind */ TemplateInfo::Kind::kNumber,
   },
   {
@@ -1570,25 +1816,25 @@
   {
     /* [7] */
     /* name */ "T",
-    /* matcher_indices */ MatcherIndicesIndex(98),
+    /* matcher_indices */ MatcherIndicesIndex(132),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [8] */
     /* name */ "L",
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(131),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [9] */
     /* name */ "T",
-    /* matcher_indices */ MatcherIndicesIndex(98),
+    /* matcher_indices */ MatcherIndicesIndex(132),
     /* kind */ TemplateInfo::Kind::kType,
   },
   {
     /* [10] */
     /* name */ "S",
-    /* matcher_indices */ MatcherIndicesIndex(97),
+    /* matcher_indices */ MatcherIndicesIndex(131),
     /* kind */ TemplateInfo::Kind::kType,
   },
 };
@@ -1604,8 +1850,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(105),
-    /* return_matcher_indices */ MatcherIndicesIndex(71),
+    /* parameters */ ParameterIndex(144),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1615,8 +1861,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(7),
-    /* parameters */ ParameterIndex(46),
-    /* return_matcher_indices */ MatcherIndicesIndex(71),
+    /* parameters */ ParameterIndex(58),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1627,7 +1873,7 @@
     /* num_templates   */ 3,
     /* templates */ TemplateIndex(0),
     /* parameters */ ParameterIndex(15),
-    /* return_matcher_indices */ MatcherIndicesIndex(71),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1637,8 +1883,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(7),
-    /* parameters */ ParameterIndex(49),
-    /* return_matcher_indices */ MatcherIndicesIndex(71),
+    /* parameters */ ParameterIndex(61),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1648,8 +1894,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(9),
-    /* parameters */ ParameterIndex(52),
-    /* return_matcher_indices */ MatcherIndicesIndex(71),
+    /* parameters */ ParameterIndex(64),
+    /* return_matcher_indices */ MatcherIndicesIndex(107),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1659,8 +1905,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(2),
-    /* parameters */ ParameterIndex(55),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* parameters */ ParameterIndex(67),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1671,7 +1917,7 @@
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(19),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1681,8 +1927,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(10),
-    /* parameters */ ParameterIndex(58),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* parameters */ ParameterIndex(70),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1692,8 +1938,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(107),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(146),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1703,8 +1949,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(109),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(148),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1714,8 +1960,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(61),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(73),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1725,8 +1971,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(111),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(150),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1736,8 +1982,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(113),
-    /* return_matcher_indices */ MatcherIndicesIndex(46),
+    /* parameters */ ParameterIndex(152),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1747,8 +1993,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(115),
-    /* return_matcher_indices */ MatcherIndicesIndex(46),
+    /* parameters */ ParameterIndex(154),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1758,8 +2004,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(64),
-    /* return_matcher_indices */ MatcherIndicesIndex(46),
+    /* parameters */ ParameterIndex(76),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1769,8 +2015,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(117),
-    /* return_matcher_indices */ MatcherIndicesIndex(46),
+    /* parameters */ ParameterIndex(156),
+    /* return_matcher_indices */ MatcherIndicesIndex(34),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1780,8 +2026,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(119),
-    /* return_matcher_indices */ MatcherIndicesIndex(79),
+    /* parameters */ ParameterIndex(158),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1791,8 +2037,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(121),
-    /* return_matcher_indices */ MatcherIndicesIndex(79),
+    /* parameters */ ParameterIndex(160),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1802,8 +2048,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
-    /* parameters */ ParameterIndex(67),
-    /* return_matcher_indices */ MatcherIndicesIndex(79),
+    /* parameters */ ParameterIndex(79),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1813,8 +2059,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(123),
-    /* return_matcher_indices */ MatcherIndicesIndex(79),
+    /* parameters */ ParameterIndex(162),
+    /* return_matcher_indices */ MatcherIndicesIndex(70),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1824,8 +2070,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(105),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(144),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1835,8 +2081,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(81),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(120),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1846,8 +2092,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(83),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(122),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1857,8 +2103,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(85),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(124),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1868,8 +2114,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(87),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(126),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1879,8 +2125,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(89),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(128),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1890,8 +2136,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(52),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(64),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1901,8 +2147,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(91),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(130),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1912,8 +2158,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(93),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(132),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1923,8 +2169,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(95),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(134),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1934,8 +2180,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(97),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(136),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1945,8 +2191,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(58),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(70),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1956,8 +2202,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(125),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(164),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1967,8 +2213,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(99),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(138),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1978,8 +2224,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(101),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(140),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -1989,8 +2235,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(103),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(142),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2000,8 +2246,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(70),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(82),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2012,7 +2258,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(23),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2023,7 +2269,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(23),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2034,7 +2280,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(5),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2045,7 +2291,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(5),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2056,7 +2302,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(27),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2067,7 +2313,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(27),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2077,8 +2323,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(73),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* parameters */ ParameterIndex(85),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2089,7 +2335,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(31),
-    /* return_matcher_indices */ MatcherIndicesIndex(77),
+    /* return_matcher_indices */ MatcherIndicesIndex(111),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2100,7 +2346,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(35),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2111,7 +2357,7 @@
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
     /* parameters */ ParameterIndex(35),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2122,7 +2368,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(10),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2133,7 +2379,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(10),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2143,8 +2389,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(76),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* parameters */ ParameterIndex(88),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2155,7 +2401,7 @@
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(1),
     /* parameters */ ParameterIndex(39),
-    /* return_matcher_indices */ MatcherIndicesIndex(78),
+    /* return_matcher_indices */ MatcherIndicesIndex(6),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2165,8 +2411,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(81),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(120),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2176,8 +2422,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(83),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(122),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2187,8 +2433,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(85),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(124),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2198,8 +2444,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(87),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(126),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2209,8 +2455,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(89),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(128),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2220,8 +2466,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 1,
     /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(52),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(64),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2231,8 +2477,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(91),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(130),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2242,8 +2488,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(93),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(132),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2253,8 +2499,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(95),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(134),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2264,8 +2510,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(97),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(136),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2275,8 +2521,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 0,
     /* templates */ TemplateIndex(/* invalid */),
-    /* parameters */ ParameterIndex(58),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(70),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2286,8 +2532,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(99),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(138),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2297,8 +2543,8 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(101),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(140),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
@@ -2308,34 +2554,210 @@
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(5),
-    /* parameters */ ParameterIndex(103),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* parameters */ ParameterIndex(142),
+    /* 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 */ 2,
+    /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
-    /* num_templates   */ 1,
-    /* templates */ TemplateIndex(0),
-    /* parameters */ ParameterIndex(85),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(91),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [66] */
     /* 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(103),
-    /* return_matcher_indices */ MatcherIndicesIndex(6),
+    /* num_templates   */ 0,
+    /* templates */ TemplateIndex(/* invalid */),
+    /* parameters */ ParameterIndex(94),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
     /* [67] */
+    /* 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(43),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [68] */
+    /* 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(97),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [69] */
+    /* 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(100),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [70] */
+    /* 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(103),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [71] */
+    /* 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(47),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [72] */
+    /* 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(106),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [73] */
+    /* 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(109),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [74] */
+    /* 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(112),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [75] */
+    /* 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(51),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [76] */
+    /* 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(115),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [77] */
+    /* 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(164),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [78] */
+    /* 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(138),
+    /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [79] */
+    /* 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(140),
+    /* 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_explicit_templates */ 0,
+    /* num_templates   */ 2,
+    /* templates */ TemplateIndex(5),
+    /* parameters */ ParameterIndex(142),
+    /* 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_explicit_templates */ 0,
+    /* num_templates   */ 1,
+    /* templates */ TemplateIndex(0),
+    /* parameters */ ParameterIndex(124),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [82] */
+    /* 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(142),
+    /* return_matcher_indices */ MatcherIndicesIndex(59),
+    /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
+  },
+  {
+    /* [83] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 5,
     /* num_explicit_templates */ 0,
@@ -2346,40 +2768,40 @@
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
-    /* [68] */
+    /* [84] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(43),
+    /* parameters */ ParameterIndex(55),
     /* return_matcher_indices */ MatcherIndicesIndex(3),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
-    /* [69] */
+    /* [85] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 2,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(79),
+    /* parameters */ ParameterIndex(118),
     /* return_matcher_indices */ MatcherIndicesIndex(3),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
-    /* [70] */
+    /* [86] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 3,
     /* num_explicit_templates */ 0,
     /* num_templates   */ 2,
     /* templates */ TemplateIndex(3),
-    /* parameters */ ParameterIndex(43),
+    /* parameters */ ParameterIndex(55),
     /* return_matcher_indices */ MatcherIndicesIndex(/* invalid */),
     /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */),
   },
   {
-    /* [71] */
+    /* [87] */
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsComputePipeline),
     /* num_parameters */ 1,
     /* num_explicit_templates */ 0,
@@ -2399,70 +2821,79 @@
     /* [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(67),
+    /* overloads */ OverloadIndex(83),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [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(68),
+    /* overloads */ OverloadIndex(84),
   },
   {
     /* [9] */
     /* fn atomic_load_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, u32) -> T */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(69),
+    /* overloads */ OverloadIndex(85),
   },
   {
     /* [10] */
     /* fn atomic_store_explicit[T : iu32, S : workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32) */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(70),
+    /* overloads */ OverloadIndex(86),
   },
   {
     /* [11] */
+    /* fn fence[F : texel_format, A : access](texture: texture_storage_1d<F, A>) */
+    /* fn fence[F : texel_format, A : access](texture: texture_storage_2d<F, A>) */
+    /* 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),
+  },
+  {
+    /* [12] */
     /* fn get_width[T : fiu32](texture: texture_1d<T>) -> u32 */
     /* fn get_width[T : fiu32](texture: texture_2d<T>, u32) -> u32 */
     /* fn get_width[T : fiu32](texture: texture_2d_array<T>, u32) -> u32 */
@@ -2483,7 +2914,7 @@
     /* overloads */ OverloadIndex(20),
   },
   {
-    /* [12] */
+    /* [13] */
     /* fn get_height[T : fiu32](texture: texture_2d<T>, u32) -> u32 */
     /* fn get_height[T : fiu32](texture: texture_2d_array<T>, u32) -> u32 */
     /* fn get_height[T : fiu32](texture: texture_3d<T>, u32) -> u32 */
@@ -2502,14 +2933,14 @@
     /* overloads */ OverloadIndex(51),
   },
   {
-    /* [13] */
+    /* [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(65),
+    /* overloads */ OverloadIndex(81),
   },
   {
-    /* [14] */
+    /* [15] */
     /* fn read[T : fiu32](texture: texture_1d<T>, coords: u32) -> vec4<T> */
     /* fn read[T : fiu32, L : iu32](texture: texture_2d<T>, coords: vec2<u32>, level: L) -> vec4<T> */
     /* fn read[T : fiu32, A : iu32, L : iu32](texture: texture_2d_array<T>, coords: vec2<u32>, array_index: A, level: L) -> vec4<T> */
@@ -2534,7 +2965,7 @@
     /* overloads */ OverloadIndex(0),
   },
   {
-    /* [15] */
+    /* [16] */
     /* fn sample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32> */
     /* fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32> */
     /* fn sample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> */
@@ -2554,10 +2985,27 @@
     /* overloads */ OverloadIndex(36),
   },
   {
-    /* [16] */
+    /* [17] */
+    /* fn write(texture: texture_storage_1d<f32_texel_format, writable>, value: vec4<f32>, coords: u32) */
+    /* fn write(texture: texture_storage_2d<f32_texel_format, writable>, value: vec4<f32>, coords: vec2<u32>) */
+    /* fn write[A : iu32](texture: texture_storage_2d_array<f32_texel_format, writable>, value: vec4<f32>, coords: vec2<u32>, array_index: A) */
+    /* fn write(texture: texture_storage_3d<f32_texel_format, writable>, value: vec4<f32>, coords: vec3<u32>) */
+    /* fn write(texture: texture_storage_1d<i32_texel_format, writable>, value: vec4<i32>, coords: u32) */
+    /* fn write(texture: texture_storage_2d<i32_texel_format, writable>, value: vec4<i32>, coords: vec2<u32>) */
+    /* fn write[A : iu32](texture: texture_storage_2d_array<i32_texel_format, writable>, value: vec4<i32>, coords: vec2<u32>, array_index: A) */
+    /* fn write(texture: texture_storage_3d<i32_texel_format, writable>, value: vec4<i32>, coords: vec3<u32>) */
+    /* fn write(texture: texture_storage_1d<u32_texel_format, writable>, value: vec4<u32>, coords: u32) */
+    /* fn write(texture: texture_storage_2d<u32_texel_format, writable>, value: vec4<u32>, coords: vec2<u32>) */
+    /* 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),
+  },
+  {
+    /* [18] */
     /* fn threadgroup_barrier(u32) */
     /* num overloads */ 1,
-    /* overloads */ OverloadIndex(71),
+    /* overloads */ OverloadIndex(87),
   },
 };
 
diff --git a/src/tint/lang/msl/msl.def b/src/tint/lang/msl/msl.def
index ffe389e..58e942b 100644
--- a/src/tint/lang/msl/msl.def
+++ b/src/tint/lang/msl/msl.def
@@ -47,6 +47,9 @@
 match readable
   : access.read
   | access.read_write
+match writable
+  : access.write
+  | access.read_write
 
 match function: address_space.function
 match workgroup_or_storage
@@ -128,6 +131,11 @@
 @stage("fragment", "compute") fn atomic_load_explicit[T: iu32, S: workgroup_or_storage](ptr<S, atomic<T>, read_write>, u32) -> T
 @stage("fragment", "compute") fn atomic_store_explicit[T: iu32, S: workgroup_or_storage](ptr<S, atomic<T>, read_write>, T, u32)
 
+@member_function fn fence[F: texel_format, A: access](texture: texture_storage_1d<F, A>)
+@member_function fn fence[F: texel_format, A: access](texture: texture_storage_2d<F, A>)
+@member_function fn fence[F: texel_format, A: access](texture: texture_storage_2d_array<F, A>)
+@member_function fn fence[F: texel_format, A: access](texture: texture_storage_3d<F, A>)
+
 @member_function fn get_width[T: fiu32](texture: texture_1d<T>) -> u32
 @member_function fn get_width[T: fiu32](texture: texture_2d<T>, u32) -> u32
 @member_function fn get_width[T: fiu32](texture: texture_2d_array<T>, u32) -> u32
@@ -200,5 +208,18 @@
 @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
 
+@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)
+@member_function fn write(texture: texture_storage_3d<f32_texel_format, writable>, value: vec4<f32>, coords: vec3<u32>)
+@member_function fn write(texture: texture_storage_1d<i32_texel_format, writable>, value: vec4<i32>, coords: u32)
+@member_function fn write(texture: texture_storage_2d<i32_texel_format, writable>, value: vec4<i32>, coords: vec2<u32>)
+@member_function fn write[A: iu32](texture: texture_storage_2d_array<i32_texel_format, writable>, value: vec4<i32>, coords: vec2<u32>, array_index: A)
+@member_function fn write(texture: texture_storage_3d<i32_texel_format, writable>, value: vec4<i32>, coords: vec3<u32>)
+@member_function fn write(texture: texture_storage_1d<u32_texel_format, writable>, value: vec4<u32>, coords: u32)
+@member_function fn write(texture: texture_storage_2d<u32_texel_format, writable>, value: vec4<u32>, coords: vec2<u32>)
+@member_function fn write[A: iu32](texture: texture_storage_2d_array<u32_texel_format, writable>, value: vec4<u32>, coords: vec2<u32>, array_index: A)
+@member_function fn write(texture: texture_storage_3d<u32_texel_format, writable>, value: vec4<u32>, coords: vec3<u32>)
+
 @stage("compute") fn threadgroup_barrier(u32)
 
diff --git a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
index 1a5824a..89e38bc 100644
--- a/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
+++ b/src/tint/lang/msl/writer/raise/builtin_polyfill.cc
@@ -90,6 +90,7 @@
                     case core::BuiltinFn::kTextureDimensions:
                     case core::BuiltinFn::kTextureLoad:
                     case core::BuiltinFn::kTextureSample:
+                    case core::BuiltinFn::kTextureStore:
                     case core::BuiltinFn::kStorageBarrier:
                     case core::BuiltinFn::kWorkgroupBarrier:
                     case core::BuiltinFn::kTextureBarrier:
@@ -149,6 +150,9 @@
                 case core::BuiltinFn::kTextureSample:
                     TextureSample(builtin);
                     break;
+                case core::BuiltinFn::kTextureStore:
+                    TextureStore(builtin);
+                    break;
 
                 // Barriers.
                 case core::BuiltinFn::kStorageBarrier:
@@ -320,6 +324,52 @@
         builtin->Destroy();
     }
 
+    /// Replace a textureStore call with the equivalent MSL intrinsic.
+    /// @param builtin the builtin call instruction
+    void TextureStore(core::ir::CoreBuiltinCall* builtin) {
+        auto* tex = builtin->Args()[0];
+        auto* tex_type = tex->Type()->As<core::type::StorageTexture>();
+
+        // Extract the arguments from the core builtin call.
+        auto* coords = builtin->Args()[1];
+        core::ir::Value* value = nullptr;
+        core::ir::Value* index = nullptr;
+        if (tex_type->dim() == core::type::TextureDimension::k2dArray) {
+            index = builtin->Args()[2];
+            value = builtin->Args()[3];
+        } else {
+            value = builtin->Args()[2];
+        }
+
+        b.InsertBefore(builtin, [&] {
+            // Convert the coordinates to unsigned integers if necessary.
+            if (coords->Type()->is_signed_integer_scalar_or_vector()) {
+                if (auto* vec = coords->Type()->As<core::type::Vector>()) {
+                    coords = b.Convert(ty.vec(ty.u32(), vec->Width()), coords)->Result(0);
+                } else {
+                    coords = b.Convert(ty.u32(), coords)->Result(0);
+                }
+            }
+
+            // Call the `write()` member function.
+            Vector<core::ir::Value*, 4> args;
+            args.Push(value);
+            args.Push(coords);
+            if (index) {
+                args.Push(index);
+            }
+            b.MemberCall<msl::ir::MemberBuiltinCall>(ty.void_(), msl::BuiltinFn::kWrite, tex,
+                                                     std::move(args));
+
+            // If we are writing to a read-write texture, add a fence to ensure that the written
+            // values are visible to subsequent reads from the same thread.
+            if (tex_type->access() == core::Access::kReadWrite) {
+                b.MemberCall<msl::ir::MemberBuiltinCall>(ty.void_(), msl::BuiltinFn::kFence, tex);
+            }
+        });
+        builtin->Destroy();
+    }
+
     /// Replace a barrier builtin with the `threadgroupBarrier()` intrinsic.
     /// @param builtin the builtin call instruction
     /// @param type the barrier type
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 8f8a76b..a997e2b 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,332 @@
     EXPECT_EQ(expect, str());
 }
 
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_1d_U32Coord) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k1d, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.u32());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_1d<rgba8unorm, write>, %coords:u32, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_1d<rgba8unorm, write>, %coords:u32, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = %t.write %value, %coords
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_1d_I32Coord) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k1d, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.i32());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_1d<rgba8unorm, write>, %coords:i32, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_1d<rgba8unorm, write>, %coords:i32, %value:vec4<f32>):void {
+  $B1: {
+    %5:u32 = convert %coords
+    %6:void = %t.write %value, %5
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2d_U32Coords) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k2d, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec2<u32>());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = %t.write %value, %coords
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2d_I32Coords) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k2d, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec2<i32>());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, write>, %coords:vec2<i32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, write>, %coords:vec2<i32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:vec2<u32> = convert %coords
+    %6:void = %t.write %value, %5
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2darray_U32Index) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k2dArray, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec2<i32>());
+    auto* index = b.FunctionParam("index", ty.u32());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, index, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, index, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_2d_array<rgba8unorm, write>, %coords:vec2<i32>, %index:u32, %value:vec4<f32>):void {
+  $B1: {
+    %6:void = textureStore %t, %coords, %index, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_2d_array<rgba8unorm, write>, %coords:vec2<i32>, %index:u32, %value:vec4<f32>):void {
+  $B1: {
+    %6:vec2<u32> = convert %coords
+    %7:void = %t.write %value, %6, %index
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2darray_I32Index) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k2dArray, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec2<i32>());
+    auto* index = b.FunctionParam("index", ty.i32());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, index, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, index, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_2d_array<rgba8unorm, write>, %coords:vec2<i32>, %index:i32, %value:vec4<f32>):void {
+  $B1: {
+    %6:void = textureStore %t, %coords, %index, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_2d_array<rgba8unorm, write>, %coords:vec2<i32>, %index:i32, %value:vec4<f32>):void {
+  $B1: {
+    %6:vec2<u32> = convert %coords
+    %7:void = %t.write %value, %6, %index
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_3d) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k3d, format, core::Access::kWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec3<i32>());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.void_());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        b.Return(func);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_3d<rgba8unorm, write>, %coords:vec3<i32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    ret
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_3d<rgba8unorm, write>, %coords:vec3<i32>, %value:vec4<f32>):void {
+  $B1: {
+    %5:vec3<u32> = convert %coords
+    %6:void = %t.write %value, %5
+    ret
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
+// Test that we insert a fence after the store to ensure that it is ordered before the load.
+TEST_F(MslWriter_BuiltinPolyfillTest, TextureStoreToReadWriteBeforeLoad) {
+    auto format = core::TexelFormat::kRgba8Unorm;
+    auto* texture_ty = ty.Get<core::type::StorageTexture>(
+        core::type::TextureDimension::k2d, format, core::Access::kReadWrite,
+        core::type::StorageTexture::SubtypeFor(format, ty));
+    auto* t = b.FunctionParam("t", texture_ty);
+    auto* coords = b.FunctionParam("coords", ty.vec2<i32>());
+    auto* value = b.FunctionParam("value", ty.vec4<f32>());
+    auto* func = b.Function("foo", ty.vec4<f32>());
+    func->SetParams({t, coords, value});
+    b.Append(func->Block(), [&] {
+        b.Call<void>(core::BuiltinFn::kTextureStore, t, coords, value);
+        auto* result = b.Call<vec4<f32>>(core::BuiltinFn::kTextureLoad, t, coords);
+        b.Return(func, result);
+    });
+
+    auto* src = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, read_write>, %coords:vec2<i32>, %value:vec4<f32>):vec4<f32> {
+  $B1: {
+    %5:void = textureStore %t, %coords, %value
+    %6:vec4<f32> = textureLoad %t, %coords
+    ret %6
+  }
+}
+)";
+    EXPECT_EQ(src, str());
+
+    auto* expect = R"(
+%foo = func(%t:texture_storage_2d<rgba8unorm, read_write>, %coords:vec2<i32>, %value:vec4<f32>):vec4<f32> {
+  $B1: {
+    %5:vec2<u32> = convert %coords
+    %6:void = %t.write %value, %5
+    %7:void = %t.fence
+    %8:vec2<u32> = convert %coords
+    %9:vec4<f32> = %t.read %8
+    ret %9
+  }
+}
+)";
+
+    Run(BuiltinPolyfill);
+
+    EXPECT_EQ(expect, str());
+}
+
 TEST_F(MslWriter_BuiltinPolyfillTest, WorkgroupBarrier) {
     auto* func = b.Function("foo", ty.void_());
     func->SetStage(core::ir::Function::PipelineStage::kCompute);
diff --git a/test/tint/bug/tint/413.spvasm.expected.ir.msl b/test/tint/bug/tint/413.spvasm.expected.ir.msl
index ee65b2d..fcfbeea 100644
--- a/test/tint/bug/tint/413.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/413.spvasm.expected.ir.msl
@@ -1,9 +1,18 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::sample> Src;
+  texture2d<uint, access::write> Dst;
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureLoad
-********************************************************************
-*  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.  *
-********************************************************************
+void main_1(tint_module_vars_struct tint_module_vars) {
+  uint4 srcValue = 0u;
+  srcValue = tint_module_vars.Src.read(uint2(int2(0)), 0);
+  srcValue[0u] = (srcValue[0u] + 1u);
+  uint4 const x_27 = srcValue;
+  tint_module_vars.Dst.write(x_27, uint2(int2(0)));
+}
+kernel void tint_symbol(texture2d<uint, access::sample> Src [[texture(0)]], texture2d<uint, access::write> Dst [[texture(1)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.Src=Src, .Dst=Dst};
+  main_1(tint_module_vars);
+}
diff --git a/test/tint/bug/tint/453.wgsl.expected.ir.msl b/test/tint/bug/tint/453.wgsl.expected.ir.msl
index ee65b2d..104f811 100644
--- a/test/tint/bug/tint/453.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/453.wgsl.expected.ir.msl
@@ -1,9 +1,17 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::sample> Src;
+  texture2d<uint, access::write> Dst;
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureLoad
-********************************************************************
-*  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.  *
-********************************************************************
+kernel void tint_symbol(texture2d<uint, access::sample> Src [[texture(0)]], texture2d<uint, access::write> Dst [[texture(1)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.Src=Src, .Dst=Dst};
+  uint4 srcValue = 0u;
+  uint4 const x_22 = tint_module_vars.Src.read(uint2(int2(0)), 0);
+  srcValue = x_22;
+  uint const x_24 = srcValue[0u];
+  uint const x_25 = (x_24 + 1u);
+  uint4 const x_27 = srcValue;
+  tint_module_vars.Dst.write(x_27.xxxx, uint2(int2(0)));
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.ir.msl
index 877ebc6..f2a5a78 100644
--- a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_00ca64(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_00ca64(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_00ca64(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_00ca64(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.ir.msl
index 877ebc6..aaf952d 100644
--- a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0148bd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0148bd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0148bd(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0148bd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/031506.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/031506.wgsl.expected.ir.msl
index bbe33ef..253051fd 100644
--- a/test/tint/builtins/gen/literal/textureStore/031506.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/031506.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_031506(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_031506 = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_031506(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_031506
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_031506(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_031506
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_031506(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_031506
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/036d0e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/036d0e.wgsl.expected.ir.msl
index 8eec2f9..a490f98 100644
--- a/test/tint/builtins/gen/literal/textureStore/036d0e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/036d0e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_036d0e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_036d0e = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_036d0e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_036d0e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_036d0e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_036d0e
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_036d0e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_036d0e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/03e7a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/03e7a0.wgsl.expected.ir.msl
index bc30d0d..286fb59 100644
--- a/test/tint/builtins/gen/literal/textureStore/03e7a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/03e7a0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_03e7a0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_03e7a0 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_03e7a0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_03e7a0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_03e7a0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_03e7a0
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_03e7a0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_03e7a0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/042b06.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/042b06.wgsl.expected.ir.msl
index 3172261..a28adee 100644
--- a/test/tint/builtins/gen/literal/textureStore/042b06.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/042b06.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_042b06(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_042b06 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_042b06(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_042b06
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_042b06(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_042b06
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_042b06(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_042b06
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/052a4e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/052a4e.wgsl.expected.ir.msl
index 1f5e66c..85c63d8 100644
--- a/test/tint/builtins/gen/literal/textureStore/052a4e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/052a4e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_052a4e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_052a4e = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_052a4e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_052a4e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_052a4e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_052a4e
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_052a4e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_052a4e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/053664.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/053664.wgsl.expected.ir.msl
index 5a7e50a..11eb6e7 100644
--- a/test/tint/builtins/gen/literal/textureStore/053664.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/053664.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_053664(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_053664 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_053664(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_053664
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_053664(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_053664
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_053664(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_053664
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/05ce15.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl.expected.ir.msl
index 877ebc6..326ebfa 100644
--- a/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_05ce15(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_05ce15(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_05ce15(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_05ce15(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.ir.msl
index 877ebc6..4589e89 100644
--- a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_064c7f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_064c7f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_064c7f(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_064c7f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/068641.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/068641.wgsl.expected.ir.msl
index 877ebc6..eacb1c8 100644
--- a/test/tint/builtins/gen/literal/textureStore/068641.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/068641.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_068641(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_068641(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_068641(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_068641(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.ir.msl
index 877ebc6..53b5d3e 100644
--- a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_06e49c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_06e49c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_06e49c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_06e49c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/07548b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/07548b.wgsl.expected.ir.msl
index 877ebc6..dabe82c 100644
--- a/test/tint/builtins/gen/literal/textureStore/07548b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/07548b.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_07548b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_07548b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_07548b(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_07548b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/09e4d5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/09e4d5.wgsl.expected.ir.msl
index 211abf2..aa3ca7e 100644
--- a/test/tint/builtins/gen/literal/textureStore/09e4d5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/09e4d5.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_09e4d5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_09e4d5 = func():void {
-  $B2: {
-    %3:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_09e4d5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_09e4d5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_09e4d5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_09e4d5
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_09e4d5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_09e4d5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0a1a79.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.ir.msl
index 877ebc6..31656a5 100644
--- a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0a1a79(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0a1a79(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0a1a79(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0a1a79(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.ir.msl
index 818c31f..d3bccfc 100644
--- a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ad124(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ad124 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ad124(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_0ad124
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ad124(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_0ad124
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ad124(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_0ad124
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0ade9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.ir.msl
index a04feb9..24a1832 100644
--- a/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ade9a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ade9a = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ade9a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_0ade9a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ade9a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_0ade9a
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ade9a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_0ade9a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0af6b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl.expected.ir.msl
index 877ebc6..dd29f31 100644
--- a/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0af6b5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0af6b5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0af6b5(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0af6b5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl.expected.ir.msl
index 877ebc6..a9451ff 100644
--- a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0c3dff(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0c3dff(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0c3dff(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0c3dff(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.ir.msl
index 877ebc6..0e5fde6 100644
--- a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0cc825(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0cc825(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0cc825(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0cc825(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ff97a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/0ff97a.wgsl.expected.ir.msl
index 2877d6d..55870ec 100644
--- a/test/tint/builtins/gen/literal/textureStore/0ff97a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/0ff97a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ff97a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ff97a = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ff97a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_0ff97a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ff97a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_0ff97a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ff97a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_0ff97a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/101325.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/101325.wgsl.expected.ir.msl
index 34a713c..ab832a2 100644
--- a/test/tint/builtins/gen/literal/textureStore/101325.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/101325.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_101325(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_101325 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_101325(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_101325
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_101325(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_101325
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_101325(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_101325
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/102722.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/102722.wgsl.expected.ir.msl
index 877ebc6..51ed342 100644
--- a/test/tint/builtins/gen/literal/textureStore/102722.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/102722.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_102722(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_102722(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_102722(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_102722(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/145061.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/145061.wgsl.expected.ir.msl
index 0404fd8..80ed2dd 100644
--- a/test/tint/builtins/gen/literal/textureStore/145061.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/145061.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_145061(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_145061 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_145061(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_145061
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_145061(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_145061
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_145061(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_145061
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/158cf0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl.expected.ir.msl
index 877ebc6..ad697ea 100644
--- a/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_158cf0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_158cf0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_158cf0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_158cf0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/178e69.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/178e69.wgsl.expected.ir.msl
index e5f72bf..097272b 100644
--- a/test/tint/builtins/gen/literal/textureStore/178e69.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/178e69.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_178e69(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_178e69 = func():void {
-  $B2: {
-    %3:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_178e69(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_178e69
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_178e69(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_178e69
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_178e69(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_178e69
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1839f2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl.expected.ir.msl
index 877ebc6..16210bf 100644
--- a/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1839f2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1839f2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1839f2(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1839f2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/195d1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/195d1b.wgsl.expected.ir.msl
index 942b4cb..be6f1e5 100644
--- a/test/tint/builtins/gen/literal/textureStore/195d1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/195d1b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_195d1b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_195d1b = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_195d1b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_195d1b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_195d1b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_195d1b
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_195d1b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_195d1b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/197637.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/197637.wgsl.expected.ir.msl
index 0934c57..6ce4feb 100644
--- a/test/tint/builtins/gen/literal/textureStore/197637.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/197637.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_197637(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_197637 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_197637(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_197637
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_197637(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_197637
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_197637(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_197637
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1a264d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.ir.msl
index 877ebc6..e41541a 100644
--- a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1a264d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a264d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a264d(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a264d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.ir.msl
index bd8673c..6f92e15 100644
--- a/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1a6c0b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1a6c0b = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a6c0b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_1a6c0b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a6c0b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_1a6c0b
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a6c0b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_1a6c0b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1a7d35.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl.expected.ir.msl
index 877ebc6..a2ccfe1 100644
--- a/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1a7d35(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a7d35(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a7d35(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a7d35(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1af236.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1af236.wgsl.expected.ir.msl
index 0266535..d82d909 100644
--- a/test/tint/builtins/gen/literal/textureStore/1af236.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1af236.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1af236(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1af236 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1af236(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_1af236
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1af236(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_1af236
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1af236(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_1af236
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1bbd08.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl.expected.ir.msl
index 877ebc6..24b5776 100644
--- a/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1bbd08(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1bbd08(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1bbd08(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1bbd08(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl.expected.ir.msl
index 877ebc6..700dc43 100644
--- a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1c02e7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1c02e7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1c02e7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1c02e7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl.expected.ir.msl
index 877ebc6..c4710eb 100644
--- a/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1dc954(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1dc954(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1dc954(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1dc954(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl.expected.ir.msl
index 877ebc6..b48e570 100644
--- a/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1e20f2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e20f2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e20f2(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e20f2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.ir.msl
index 877ebc6..c998511 100644
--- a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1e79f0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e79f0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e79f0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e79f0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e9fbd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1e9fbd.wgsl.expected.ir.msl
index 9353add..5a88ce3 100644
--- a/test/tint/builtins/gen/literal/textureStore/1e9fbd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1e9fbd.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1e9fbd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1e9fbd = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e9fbd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_1e9fbd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e9fbd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_1e9fbd
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e9fbd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_1e9fbd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1efc36.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl.expected.ir.msl
index 877ebc6..4923f4a 100644
--- a/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1efc36(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1efc36(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1efc36(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1efc36(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.ir.msl
index 877ebc6..d414289 100644
--- a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1f1ef8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1f1ef8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1f1ef8(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1f1ef8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1fef04.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/1fef04.wgsl.expected.ir.msl
index 693f553..7fe4eb4 100644
--- a/test/tint/builtins/gen/literal/textureStore/1fef04.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/1fef04.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1fef04(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1fef04 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1fef04(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_1fef04
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1fef04(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_1fef04
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1fef04(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_1fef04
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2046db.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2046db.wgsl.expected.ir.msl
index 07fa7a6..51a5eeb 100644
--- a/test/tint/builtins/gen/literal/textureStore/2046db.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2046db.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2046db(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2046db = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2046db(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2046db
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2046db(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2046db
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2046db(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2046db
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/207fdd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl.expected.ir.msl
index 877ebc6..8dcb40a 100644
--- a/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_207fdd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_207fdd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_207fdd(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_207fdd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2173fd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2173fd.wgsl.expected.ir.msl
index 645ab03..2eeee71 100644
--- a/test/tint/builtins/gen/literal/textureStore/2173fd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2173fd.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2173fd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2173fd = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2173fd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2173fd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2173fd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2173fd
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2173fd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2173fd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/22d955.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl.expected.ir.msl
index 877ebc6..bfa580b 100644
--- a/test/tint/builtins/gen/literal/textureStore/22d955.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_22d955(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_22d955(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22d955(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22d955(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.ir.msl
index 877ebc6..c7dcd86161 100644
--- a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_22f045(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_22f045(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22f045(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22f045(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.ir.msl
index 877ebc6..edd0eac 100644
--- a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2383fc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2383fc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2383fc(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2383fc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/24e6b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/24e6b7.wgsl.expected.ir.msl
index 8b73497..12062be 100644
--- a/test/tint/builtins/gen/literal/textureStore/24e6b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/24e6b7.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_24e6b7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_24e6b7 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_24e6b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_24e6b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_24e6b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_24e6b7
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_24e6b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_24e6b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/258ab0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.ir.msl
index 877ebc6..808985e 100644
--- a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_258ab0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_258ab0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_258ab0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_258ab0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/26a26d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/26a26d.wgsl.expected.ir.msl
index 228bd7c..0d9b93e 100644
--- a/test/tint/builtins/gen/literal/textureStore/26a26d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/26a26d.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_26a26d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_26a26d = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_26a26d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_26a26d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26a26d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_26a26d
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26a26d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_26a26d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/26bf70.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl.expected.ir.msl
index 877ebc6..03ef719 100644
--- a/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_26bf70(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_26bf70(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26bf70(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26bf70(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/27063a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/27063a.wgsl.expected.ir.msl
index 877ebc6..784d676 100644
--- a/test/tint/builtins/gen/literal/textureStore/27063a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/27063a.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_27063a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_27063a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_27063a(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_27063a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.ir.msl
index 7f54cc5..65a699f 100644
--- a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_272f5a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_272f5a = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_272f5a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_272f5a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_272f5a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_272f5a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_272f5a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_272f5a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2796b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.ir.msl
index 877ebc6..54c9e61 100644
--- a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2796b4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2796b4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2796b4(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2796b4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/285218.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/285218.wgsl.expected.ir.msl
index 877ebc6..23c3f0b 100644
--- a/test/tint/builtins/gen/literal/textureStore/285218.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/285218.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_285218(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_285218(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_285218(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_285218(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.ir.msl
index 877ebc6..644dd41 100644
--- a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_28a7ec(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_28a7ec(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28a7ec(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28a7ec(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28e109.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/28e109.wgsl.expected.ir.msl
index b1ce0d9..194c7d6 100644
--- a/test/tint/builtins/gen/literal/textureStore/28e109.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/28e109.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_28e109(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_28e109 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_28e109(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_28e109
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28e109(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_28e109
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28e109(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_28e109
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2a60c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2a60c9.wgsl.expected.ir.msl
index fdec6c9..a901bfe 100644
--- a/test/tint/builtins/gen/literal/textureStore/2a60c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2a60c9.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2a60c9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2a60c9 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2a60c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2a60c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2a60c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2a60c9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2a60c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2a60c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2ac6c7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl.expected.ir.msl
index 877ebc6..486026e 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2ac6c7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2ac6c7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ac6c7(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ac6c7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2addd6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2addd6.wgsl.expected.ir.msl
index 82b6db3..b07b943 100644
--- a/test/tint/builtins/gen/literal/textureStore/2addd6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2addd6.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2addd6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2addd6 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2addd6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2addd6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2addd6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2addd6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2addd6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2addd6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2c76db.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2c76db.wgsl.expected.ir.msl
index 847edd3..db81302 100644
--- a/test/tint/builtins/gen/literal/textureStore/2c76db.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2c76db.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2c76db(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2c76db = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2c76db(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2c76db
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2c76db(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2c76db
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2c76db(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2c76db
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2d2835.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.ir.msl
index 877ebc6..4d29405 100644
--- a/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2d2835(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2d2835(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2d2835(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2d2835(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl.expected.ir.msl
index 877ebc6..a51b785 100644
--- a/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2e4245(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e4245(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e4245(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e4245(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.ir.msl
index 87b746f..c92b293 100644
--- a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2e512f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2e512f = func():void {
-  $B2: {
-    %3:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e512f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2e512f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e512f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2e512f
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e512f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2e512f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2e6102.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl.expected.ir.msl
index 877ebc6..b6dd653 100644
--- a/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2e6102(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e6102(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e6102(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e6102(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl.expected.ir.msl
index 877ebc6..80574b3 100644
--- a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2eb2a4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2eb2a4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2eb2a4(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2eb2a4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl.expected.ir.msl
index 877ebc6..004bd53 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2ed2a3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2ed2a3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ed2a3(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ed2a3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2f29ea.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/2f29ea.wgsl.expected.ir.msl
index 757a9f5..0cdadbb 100644
--- a/test/tint/builtins/gen/literal/textureStore/2f29ea.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/2f29ea.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2f29ea(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2f29ea = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2f29ea(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_2f29ea
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2f29ea(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_2f29ea
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2f29ea(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_2f29ea
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/30b0b0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.ir.msl
index 877ebc6..afecbf2 100644
--- a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_30b0b0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_30b0b0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_30b0b0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_30b0b0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/312f27.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/312f27.wgsl.expected.ir.msl
index 477aa39..c199894 100644
--- a/test/tint/builtins/gen/literal/textureStore/312f27.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/312f27.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_312f27(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_312f27 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_312f27(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_312f27
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_312f27(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_312f27
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_312f27(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_312f27
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/31745b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.ir.msl
index 877ebc6..4185bcb 100644
--- a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_31745b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_31745b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_31745b(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_31745b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/319029.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/319029.wgsl.expected.ir.msl
index 877ebc6..a7142b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/319029.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/319029.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_319029(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_319029(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_319029(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_319029(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/32d3d6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/32d3d6.wgsl.expected.ir.msl
index 7813a9d..8ec3c23 100644
--- a/test/tint/builtins/gen/literal/textureStore/32d3d6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/32d3d6.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_32d3d6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_32d3d6 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_32d3d6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_32d3d6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32d3d6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_32d3d6
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32d3d6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_32d3d6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/32f368.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl.expected.ir.msl
index 877ebc6..3cb7fdf 100644
--- a/test/tint/builtins/gen/literal/textureStore/32f368.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_32f368(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_32f368(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32f368(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32f368(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl.expected.ir.msl
index 877ebc6..f9903a3 100644
--- a/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_330b7c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_330b7c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_330b7c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_330b7c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3310d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3310d3.wgsl.expected.ir.msl
index b5ff31e..9a27a73 100644
--- a/test/tint/builtins/gen/literal/textureStore/3310d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3310d3.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3310d3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3310d3 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3310d3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_3310d3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3310d3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_3310d3
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3310d3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_3310d3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/331aee.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl.expected.ir.msl
index 877ebc6..de3993c 100644
--- a/test/tint/builtins/gen/literal/textureStore/331aee.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_331aee(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_331aee(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_331aee(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_331aee(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.ir.msl
index 877ebc6..b8fb3ab 100644
--- a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_33cec0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_33cec0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_33cec0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_33cec0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/345332.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/345332.wgsl.expected.ir.msl
index 5393bfd..2661f8a 100644
--- a/test/tint/builtins/gen/literal/textureStore/345332.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/345332.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_345332(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_345332 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_345332(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_345332
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_345332(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_345332
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_345332(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_345332
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/37eeef.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.ir.msl
index 877ebc6..7090aaa 100644
--- a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_37eeef(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_37eeef(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37eeef(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37eeef(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.ir.msl
index 877ebc6..9b34288 100644
--- a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_37ffd4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_37ffd4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37ffd4(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37ffd4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl.expected.ir.msl
index 877ebc6..0b375e0 100644
--- a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_38e8d7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_38e8d7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_38e8d7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_38e8d7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl.expected.ir.msl
index 877ebc6..1fb5680 100644
--- a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3a52ac(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3a52ac(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3a52ac(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3a52ac(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl.expected.ir.msl
index 877ebc6..738c237 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3bb7a1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3bb7a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bb7a1(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bb7a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl.expected.ir.msl
index 877ebc6..1129b26 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3bec15(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3bec15(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bec15(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bec15(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl.expected.ir.msl
index 877ebc6..ec1181f 100644
--- a/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3c1937(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3c1937(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3c1937(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3c1937(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3d1ebe.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3d1ebe.wgsl.expected.ir.msl
index 6858e00..48b58b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/3d1ebe.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3d1ebe.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3d1ebe(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3d1ebe = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d1ebe(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_3d1ebe
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d1ebe(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_3d1ebe
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d1ebe(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_3d1ebe
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3d6f01.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.ir.msl
index 877ebc6..af85f79 100644
--- a/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3d6f01(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d6f01(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d6f01(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d6f01(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3d96a4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3d96a4.wgsl.expected.ir.msl
index 6f074c1..3a97b98 100644
--- a/test/tint/builtins/gen/literal/textureStore/3d96a4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3d96a4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3d96a4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3d96a4 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d96a4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_3d96a4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d96a4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_3d96a4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d96a4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_3d96a4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3e0dc4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.ir.msl
index bc9a5c1..f28c200 100644
--- a/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3e0dc4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3e0dc4 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3e0dc4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_3e0dc4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3e0dc4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_3e0dc4
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3e0dc4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_3e0dc4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3f61ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3f61ca.wgsl.expected.ir.msl
index ff0ae1b..6787b3c 100644
--- a/test/tint/builtins/gen/literal/textureStore/3f61ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3f61ca.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3f61ca(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3f61ca = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3f61ca(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_3f61ca
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3f61ca(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_3f61ca
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3f61ca(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_3f61ca
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3fb31f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.ir.msl
index 877ebc6..ff58bb1 100644
--- a/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3fb31f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3fb31f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3fb31f(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3fb31f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/40c455.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/40c455.wgsl.expected.ir.msl
index 877ebc6..39410a4 100644
--- a/test/tint/builtins/gen/literal/textureStore/40c455.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/40c455.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_40c455(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_40c455(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_40c455(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_40c455(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl.expected.ir.msl
index 877ebc6..35aec49 100644
--- a/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4288fc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4288fc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4288fc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4288fc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.ir.msl
index b852d69..88b04e2 100644
--- a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_43d1df(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_43d1df = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_43d1df(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_43d1df
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_43d1df(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_43d1df
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_43d1df(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_43d1df
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/441222.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/441222.wgsl.expected.ir.msl
index 44b3828..d360676 100644
--- a/test/tint/builtins/gen/literal/textureStore/441222.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/441222.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_441222(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_441222 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_441222(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_441222
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441222(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_441222
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441222(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_441222
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/441ba8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl.expected.ir.msl
index 877ebc6..f3d9889 100644
--- a/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_441ba8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_441ba8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441ba8(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441ba8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4483e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4483e7.wgsl.expected.ir.msl
index 1658b1e..6610297 100644
--- a/test/tint/builtins/gen/literal/textureStore/4483e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4483e7.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4483e7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4483e7 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4483e7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4483e7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4483e7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4483e7
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4483e7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4483e7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/44b372.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/44b372.wgsl.expected.ir.msl
index c958470..7dee2c0 100644
--- a/test/tint/builtins/gen/literal/textureStore/44b372.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/44b372.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_44b372(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_44b372 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_44b372(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_44b372
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44b372(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_44b372
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44b372(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_44b372
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/44daa7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.ir.msl
index 877ebc6..d6f8292 100644
--- a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_44daa7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_44daa7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44daa7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44daa7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.ir.msl
index 9ba0477..f52672b 100644
--- a/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_473ead(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_473ead = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_473ead(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_473ead
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_473ead(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_473ead
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_473ead(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_473ead
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/47bd70.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/47bd70.wgsl.expected.ir.msl
index 5be639f..e0fdc95 100644
--- a/test/tint/builtins/gen/literal/textureStore/47bd70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/47bd70.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_47bd70(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_47bd70 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_47bd70(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_47bd70
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_47bd70(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_47bd70
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_47bd70(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_47bd70
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/486500.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/486500.wgsl.expected.ir.msl
index 877ebc6..3356ff9 100644
--- a/test/tint/builtins/gen/literal/textureStore/486500.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/486500.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_486500(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_486500(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_486500(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_486500(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/48cb56.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/48cb56.wgsl.expected.ir.msl
index 25f9a8d..e413d02e 100644
--- a/test/tint/builtins/gen/literal/textureStore/48cb56.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/48cb56.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_48cb56(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_48cb56 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_48cb56(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_48cb56
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48cb56(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_48cb56
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48cb56(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_48cb56
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/48eae1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.ir.msl
index 877ebc6..5294ed6 100644
--- a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_48eae1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_48eae1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48eae1(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48eae1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4bf1fd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4bf1fd.wgsl.expected.ir.msl
index 0239fee..3835eb5 100644
--- a/test/tint/builtins/gen/literal/textureStore/4bf1fd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4bf1fd.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4bf1fd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4bf1fd = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4bf1fd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4bf1fd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4bf1fd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4bf1fd
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4bf1fd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4bf1fd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4c454f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.ir.msl
index 877ebc6..a1e4d9d 100644
--- a/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4c454f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4c454f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c454f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c454f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4c76b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4c76b7.wgsl.expected.ir.msl
index c18392f..55b1cf2 100644
--- a/test/tint/builtins/gen/literal/textureStore/4c76b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4c76b7.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4c76b7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4c76b7 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4c76b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4c76b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c76b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4c76b7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c76b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4c76b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4cce74.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.ir.msl
index 61f3b4c..28b519d 100644
--- a/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4cce74(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4cce74 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4cce74(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4cce74
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4cce74(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4cce74
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4cce74(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4cce74
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4d359d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.ir.msl
index 877ebc6..cbc6aee 100644
--- a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4d359d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4d359d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4d359d(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4d359d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4ddf52.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4ddf52.wgsl.expected.ir.msl
index 6c09869..0c5625d 100644
--- a/test/tint/builtins/gen/literal/textureStore/4ddf52.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4ddf52.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4ddf52(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4ddf52 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4ddf52(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4ddf52
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4ddf52(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4ddf52
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4ddf52(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4ddf52
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4e2b3a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.ir.msl
index 3ce2f27..4ca8f33 100644
--- a/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4e2b3a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4e2b3a = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4e2b3a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_4e2b3a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4e2b3a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_4e2b3a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4e2b3a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_4e2b3a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4fc057.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl.expected.ir.msl
index 877ebc6..1fec532 100644
--- a/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4fc057(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4fc057(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4fc057(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4fc057(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5030f5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5030f5.wgsl.expected.ir.msl
index 85929e5..81f57f9 100644
--- a/test/tint/builtins/gen/literal/textureStore/5030f5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5030f5.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5030f5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5030f5 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5030f5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5030f5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5030f5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5030f5
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5030f5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5030f5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/506a71.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.ir.msl
index 877ebc6..b99f149 100644
--- a/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_506a71(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_506a71(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_506a71(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_506a71(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.ir.msl
index 3ad0935..80c8299 100644
--- a/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_51ec82(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_51ec82 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_51ec82(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_51ec82
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_51ec82(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_51ec82
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_51ec82(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_51ec82
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5246b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5246b4.wgsl.expected.ir.msl
index 32ce08a..e9a9569 100644
--- a/test/tint/builtins/gen/literal/textureStore/5246b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5246b4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5246b4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5246b4 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5246b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5246b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5246b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5246b4
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5246b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5246b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/52f503.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/52f503.wgsl.expected.ir.msl
index 877ebc6..6126748 100644
--- a/test/tint/builtins/gen/literal/textureStore/52f503.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/52f503.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_52f503(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_52f503(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_52f503(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_52f503(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/53a68b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/53a68b.wgsl.expected.ir.msl
index d84ecd0..040de0b 100644
--- a/test/tint/builtins/gen/literal/textureStore/53a68b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/53a68b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_53a68b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_53a68b = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_53a68b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_53a68b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_53a68b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_53a68b
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_53a68b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_53a68b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5425ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.ir.msl
index 05ca46d..f487f58 100644
--- a/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5425ab(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5425ab = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5425ab(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5425ab
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5425ab(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5425ab
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5425ab(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5425ab
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/544f06.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/544f06.wgsl.expected.ir.msl
index 8936663..cedfaf7 100644
--- a/test/tint/builtins/gen/literal/textureStore/544f06.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/544f06.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_544f06(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_544f06 = func():void {
-  $B2: {
-    %3:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_544f06(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_544f06
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_544f06(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_544f06
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_544f06(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_544f06
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/55f9dc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/55f9dc.wgsl.expected.ir.msl
index 80d5b8e..8217dff 100644
--- a/test/tint/builtins/gen/literal/textureStore/55f9dc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/55f9dc.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_55f9dc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_55f9dc = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_55f9dc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_55f9dc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_55f9dc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_55f9dc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_55f9dc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_55f9dc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/574a31.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.ir.msl
index 83cf013..a6a9114 100644
--- a/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_574a31(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_574a31 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_574a31(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_574a31
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_574a31(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_574a31
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_574a31(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_574a31
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/579b93.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/579b93.wgsl.expected.ir.msl
index f2070ba..530ac8d 100644
--- a/test/tint/builtins/gen/literal/textureStore/579b93.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/579b93.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_579b93(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_579b93 = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_579b93(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_579b93
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_579b93(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_579b93
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_579b93(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_579b93
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5841f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl.expected.ir.msl
index 877ebc6..da550e4 100644
--- a/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5841f8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5841f8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5841f8(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5841f8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/58fc35.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/58fc35.wgsl.expected.ir.msl
index 375e6e4..ae41404 100644
--- a/test/tint/builtins/gen/literal/textureStore/58fc35.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/58fc35.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_58fc35(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_58fc35 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_58fc35(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_58fc35
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_58fc35(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_58fc35
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_58fc35(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_58fc35
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/59a0ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.ir.msl
index 877ebc6..6ece35a 100644
--- a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_59a0ab(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_59a0ab(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_59a0ab(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_59a0ab(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl.expected.ir.msl
index 877ebc6..4de0398 100644
--- a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5a2f8f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5a2f8f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a2f8f(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a2f8f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5a8b41.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5a8b41.wgsl.expected.ir.msl
index 4632423..75d0e00 100644
--- a/test/tint/builtins/gen/literal/textureStore/5a8b41.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5a8b41.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5a8b41(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5a8b41 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5a8b41(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5a8b41
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a8b41(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5a8b41
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a8b41(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5a8b41
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5b17eb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.ir.msl
index 3c604d0..2545833 100644
--- a/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5b17eb(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5b17eb = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5b17eb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5b17eb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b17eb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5b17eb
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b17eb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5b17eb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5b4522.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5b4522.wgsl.expected.ir.msl
index fc2a5a7..5469b07 100644
--- a/test/tint/builtins/gen/literal/textureStore/5b4522.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5b4522.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5b4522(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5b4522 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5b4522(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5b4522
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b4522(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5b4522
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b4522(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5b4522
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5bc4f3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.ir.msl
index 877ebc6..ce68bf0 100644
--- a/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5bc4f3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5bc4f3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5bc4f3(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5bc4f3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.ir.msl
index 877ebc6..93aa3b2 100644
--- a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5ddc61(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ddc61(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ddc61(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ddc61(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ec6b2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5ec6b2.wgsl.expected.ir.msl
index 59a8df5..86af016 100644
--- a/test/tint/builtins/gen/literal/textureStore/5ec6b2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5ec6b2.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5ec6b2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5ec6b2 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ec6b2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5ec6b2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ec6b2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5ec6b2
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ec6b2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5ec6b2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5ee194.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.ir.msl
index 7e2da69..19c5aa2 100644
--- a/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5ee194(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5ee194 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ee194(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_5ee194
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ee194(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_5ee194
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ee194(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_5ee194
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5f9a49.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl.expected.ir.msl
index 877ebc6..48651df 100644
--- a/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5f9a49(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5f9a49(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5f9a49(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5f9a49(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.ir.msl
index 877ebc6..30cafb1 100644
--- a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_602b5a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_602b5a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_602b5a(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_602b5a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl.expected.ir.msl
index 877ebc6..63d1b71 100644
--- a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_60975f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_60975f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_60975f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_60975f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/614b58.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/614b58.wgsl.expected.ir.msl
index 5777b67..33528ec 100644
--- a/test/tint/builtins/gen/literal/textureStore/614b58.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/614b58.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_614b58(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_614b58 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_614b58(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_614b58
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_614b58(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_614b58
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_614b58(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_614b58
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/635584.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.ir.msl
index 428d45d..e55b374 100644
--- a/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_635584(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_635584 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_635584(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_635584
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_635584(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_635584
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_635584(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_635584
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/63f34a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.ir.msl
index 5403af3..70f85d0 100644
--- a/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_63f34a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_63f34a = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_63f34a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_63f34a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_63f34a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_63f34a
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_63f34a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_63f34a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/646dbc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/646dbc.wgsl.expected.ir.msl
index 5f76504..395d24f 100644
--- a/test/tint/builtins/gen/literal/textureStore/646dbc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/646dbc.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_646dbc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_646dbc = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_646dbc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_646dbc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_646dbc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_646dbc
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_646dbc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_646dbc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/658a74.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.ir.msl
index 877ebc6..1340251 100644
--- a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_658a74(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_658a74(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_658a74(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_658a74(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/65b6aa.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/65b6aa.wgsl.expected.ir.msl
index 8e25743..2d8aa24 100644
--- a/test/tint/builtins/gen/literal/textureStore/65b6aa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/65b6aa.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_65b6aa(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_65b6aa = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_65b6aa(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_65b6aa
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65b6aa(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_65b6aa
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65b6aa(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_65b6aa
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/65ba8b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.ir.msl
index c1c500b..ac09169 100644
--- a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_65ba8b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_65ba8b = func():void {
-  $B2: {
-    %3:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_65ba8b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_65ba8b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65ba8b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_65ba8b
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65ba8b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_65ba8b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/682fd6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.ir.msl
index 877ebc6..e68fa73 100644
--- a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_682fd6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_682fd6(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_682fd6(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_682fd6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl.expected.ir.msl
index 877ebc6..28e0f1a 100644
--- a/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_699a1b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_699a1b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_699a1b(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_699a1b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl.expected.ir.msl
index 877ebc6..12bf298 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6b75c3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6b75c3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b75c3(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b75c3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl.expected.ir.msl
index 877ebc6..2de6976 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6b80d2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6b80d2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b80d2(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b80d2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6be9e0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6be9e0.wgsl.expected.ir.msl
index 86333e3b..c6f9a46 100644
--- a/test/tint/builtins/gen/literal/textureStore/6be9e0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6be9e0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6be9e0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6be9e0 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6be9e0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6be9e0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6be9e0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6be9e0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6be9e0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6be9e0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6c4a70.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6c4a70.wgsl.expected.ir.msl
index fb606a2..0c74fb1 100644
--- a/test/tint/builtins/gen/literal/textureStore/6c4a70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6c4a70.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6c4a70(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6c4a70 = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6c4a70(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6c4a70
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6c4a70(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6c4a70
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6c4a70(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6c4a70
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6cff2e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl.expected.ir.msl
index 877ebc6..27aead8 100644
--- a/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6cff2e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6cff2e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6cff2e(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6cff2e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6d1809.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6d1809.wgsl.expected.ir.msl
index 92d193f..ffcac17 100644
--- a/test/tint/builtins/gen/literal/textureStore/6d1809.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6d1809.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6d1809(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6d1809 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6d1809(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6d1809
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d1809(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6d1809
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d1809(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6d1809
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6d259f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6d259f.wgsl.expected.ir.msl
index 53e68a4..1dfdf86 100644
--- a/test/tint/builtins/gen/literal/textureStore/6d259f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6d259f.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6d259f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6d259f = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6d259f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6d259f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d259f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6d259f
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d259f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6d259f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6da692.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl.expected.ir.msl
index 877ebc6..269f994 100644
--- a/test/tint/builtins/gen/literal/textureStore/6da692.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6da692(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6da692(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6da692(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6da692(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6e6cc0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6e6cc0.wgsl.expected.ir.msl
index 15e2053..5af5986 100644
--- a/test/tint/builtins/gen/literal/textureStore/6e6cc0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6e6cc0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6e6cc0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6e6cc0 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6e6cc0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6e6cc0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6e6cc0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6e6cc0
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6e6cc0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6e6cc0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f0c92.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.ir.msl
index c0ea989..10feec7 100644
--- a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6f0c92(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6f0c92 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f0c92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6f0c92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f0c92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6f0c92
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f0c92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6f0c92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f3542.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6f3542.wgsl.expected.ir.msl
index c8419b7..585efad 100644
--- a/test/tint/builtins/gen/literal/textureStore/6f3542.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6f3542.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6f3542(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6f3542 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f3542(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6f3542
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f3542(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6f3542
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f3542(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6f3542
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f8642.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.ir.msl
index 877ebc6..e4330fe 100644
--- a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6f8642(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f8642(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f8642(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f8642(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6fb99b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6fb99b.wgsl.expected.ir.msl
index eb90406..9a6818f 100644
--- a/test/tint/builtins/gen/literal/textureStore/6fb99b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6fb99b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6fb99b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6fb99b = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6fb99b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_6fb99b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fb99b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_6fb99b
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fb99b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_6fb99b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6fd2b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.ir.msl
index 877ebc6..c47bb1e 100644
--- a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6fd2b1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6fd2b1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fd2b1(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fd2b1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/704e1f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/704e1f.wgsl.expected.ir.msl
index ea067ff..896bc28 100644
--- a/test/tint/builtins/gen/literal/textureStore/704e1f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/704e1f.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_704e1f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_704e1f = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_704e1f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_704e1f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_704e1f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_704e1f
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_704e1f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_704e1f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/706236.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/706236.wgsl.expected.ir.msl
index 371f4b7..0e8d162 100644
--- a/test/tint/builtins/gen/literal/textureStore/706236.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/706236.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_706236(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_706236 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_706236(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_706236
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706236(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_706236
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706236(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_706236
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/706560.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/706560.wgsl.expected.ir.msl
index 2380b1e..cd121d3 100644
--- a/test/tint/builtins/gen/literal/textureStore/706560.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/706560.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_706560(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_706560 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_706560(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_706560
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706560(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_706560
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706560(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_706560
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/726472.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.ir.msl
index 877ebc6..d5609a6 100644
--- a/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_726472(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_726472(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726472(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726472(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/726d6d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/726d6d.wgsl.expected.ir.msl
index a4e6ce8..0f083e0 100644
--- a/test/tint/builtins/gen/literal/textureStore/726d6d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/726d6d.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_726d6d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_726d6d = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_726d6d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_726d6d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726d6d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_726d6d
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726d6d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_726d6d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/72fa64.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.ir.msl
index 877ebc6..3cac01e 100644
--- a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_72fa64(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_72fa64(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_72fa64(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_72fa64(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/731349.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/731349.wgsl.expected.ir.msl
index 877ebc6..fc06f20 100644
--- a/test/tint/builtins/gen/literal/textureStore/731349.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/731349.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_731349(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_731349(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_731349(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_731349(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/73a735.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/73a735.wgsl.expected.ir.msl
index 9da11f0..4999cd9 100644
--- a/test/tint/builtins/gen/literal/textureStore/73a735.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/73a735.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_73a735(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_73a735 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_73a735(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_73a735
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73a735(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_73a735
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73a735(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_73a735
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/73bbbc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl.expected.ir.msl
index 877ebc6..b28c9c7 100644
--- a/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_73bbbc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_73bbbc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73bbbc(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73bbbc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.ir.msl
index 877ebc6..65d5b1c 100644
--- a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_74886f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_74886f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_74886f(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_74886f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/751256.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/751256.wgsl.expected.ir.msl
index 582856e..5011dcb 100644
--- a/test/tint/builtins/gen/literal/textureStore/751256.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/751256.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_751256(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_751256 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_751256(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_751256
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_751256(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_751256
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_751256(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_751256
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/752da6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl.expected.ir.msl
index 877ebc6..e84ef5f 100644
--- a/test/tint/builtins/gen/literal/textureStore/752da6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_752da6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_752da6(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_752da6(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_752da6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.ir.msl
index 1c580fd..dbf5047 100644
--- a/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_75bbd5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_75bbd5 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_75bbd5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_75bbd5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_75bbd5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_75bbd5
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_75bbd5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_75bbd5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/76affd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/76affd.wgsl.expected.ir.msl
index 877ebc6..b3535d3 100644
--- a/test/tint/builtins/gen/literal/textureStore/76affd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/76affd.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_76affd(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_76affd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_76affd(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_76affd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.ir.msl
index b1399f7..63afe0d 100644
--- a/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7792fa(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7792fa = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7792fa(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_7792fa
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7792fa(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_7792fa
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7792fa(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_7792fa
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/779d14.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/779d14.wgsl.expected.ir.msl
index 877ebc6..67eadad 100644
--- a/test/tint/builtins/gen/literal/textureStore/779d14.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/779d14.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_779d14(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_779d14(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_779d14(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_779d14(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl.expected.ir.msl
index 877ebc6..de7a0c6 100644
--- a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_77c0ae(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_77c0ae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_77c0ae(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_77c0ae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.ir.msl
index 74b9040..514b152 100644
--- a/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7b8f86(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7b8f86 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7b8f86(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_7b8f86
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7b8f86(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_7b8f86
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7b8f86(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_7b8f86
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7bb211.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.ir.msl
index 877ebc6..1c9d203 100644
--- a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7bb211(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7bb211(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7bb211(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7bb211(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl.expected.ir.msl
index 877ebc6..fee4640 100644
--- a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7cec8d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7cec8d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cec8d(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cec8d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl.expected.ir.msl
index 877ebc6..d973445 100644
--- a/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7cf6e7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7cf6e7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cf6e7(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cf6e7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7d10e0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7d10e0.wgsl.expected.ir.msl
index f55840b..826ad00 100644
--- a/test/tint/builtins/gen/literal/textureStore/7d10e0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7d10e0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7d10e0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7d10e0 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7d10e0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_7d10e0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7d10e0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_7d10e0
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7d10e0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_7d10e0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7dd042.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7dd042.wgsl.expected.ir.msl
index 33aa100..c913473 100644
--- a/test/tint/builtins/gen/literal/textureStore/7dd042.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7dd042.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7dd042(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7dd042 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7dd042(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_7dd042
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7dd042(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_7dd042
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7dd042(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_7dd042
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7e787a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7e787a.wgsl.expected.ir.msl
index 3136246..b9b0f3a 100644
--- a/test/tint/builtins/gen/literal/textureStore/7e787a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7e787a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7e787a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7e787a = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7e787a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_7e787a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7e787a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_7e787a
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7e787a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_7e787a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7f7fae.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl.expected.ir.msl
index 877ebc6..a7b7388 100644
--- a/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7f7fae(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7f7fae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7f7fae(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7f7fae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.ir.msl
index 03fc8e8..7dfa795 100644
--- a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_803a10(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_803a10 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_803a10(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_803a10
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_803a10(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_803a10
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_803a10(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_803a10
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/804942.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/804942.wgsl.expected.ir.msl
index 877ebc6..632c311 100644
--- a/test/tint/builtins/gen/literal/textureStore/804942.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/804942.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_804942(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_804942(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_804942(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_804942(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl.expected.ir.msl
index 877ebc6..0139582 100644
--- a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_805dae(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_805dae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_805dae(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_805dae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.ir.msl
index 2e850de..3a9419d 100644
--- a/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_80bf1d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_80bf1d = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_80bf1d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_80bf1d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_80bf1d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_80bf1d
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_80bf1d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_80bf1d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/818df6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/818df6.wgsl.expected.ir.msl
index 710f14c..9006758 100644
--- a/test/tint/builtins/gen/literal/textureStore/818df6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/818df6.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_818df6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_818df6 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_818df6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_818df6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_818df6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_818df6
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_818df6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_818df6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/81ae31.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/81ae31.wgsl.expected.ir.msl
index 74b9fdc..6dd50b0 100644
--- a/test/tint/builtins/gen/literal/textureStore/81ae31.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/81ae31.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_81ae31(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_81ae31 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_81ae31(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_81ae31
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_81ae31(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_81ae31
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_81ae31(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_81ae31
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/820272.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.ir.msl
index f986a9a..f41a72e 100644
--- a/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_820272(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_820272 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_820272(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_820272
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_820272(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_820272
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_820272(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_820272
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/83bcc1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.ir.msl
index 877ebc6..2364152 100644
--- a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_83bcc1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_83bcc1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_83bcc1(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_83bcc1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.ir.msl
index e4f3eec..3c5167a 100644
--- a/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_84d435(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_84d435 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_84d435(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_84d435
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84d435(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_84d435
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84d435(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_84d435
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/84f4f4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/84f4f4.wgsl.expected.ir.msl
index bc86db9..c3be480 100644
--- a/test/tint/builtins/gen/literal/textureStore/84f4f4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/84f4f4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_84f4f4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_84f4f4 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_84f4f4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_84f4f4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84f4f4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_84f4f4
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84f4f4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_84f4f4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8676c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8676c9.wgsl.expected.ir.msl
index 4ca237c..3aad56c 100644
--- a/test/tint/builtins/gen/literal/textureStore/8676c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8676c9.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8676c9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8676c9 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8676c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8676c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8676c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8676c9
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8676c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8676c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/86f713.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/86f713.wgsl.expected.ir.msl
index 39ac939..9435bb2 100644
--- a/test/tint/builtins/gen/literal/textureStore/86f713.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/86f713.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_86f713(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_86f713 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_86f713(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_86f713
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_86f713(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_86f713
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_86f713(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_86f713
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/872747.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.ir.msl
index 877ebc6..33d7966 100644
--- a/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_872747(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_872747(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_872747(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_872747(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/877c92.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/877c92.wgsl.expected.ir.msl
index c8d0780..02cee20 100644
--- a/test/tint/builtins/gen/literal/textureStore/877c92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/877c92.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_877c92(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_877c92 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_877c92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_877c92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_877c92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_877c92
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_877c92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_877c92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8815b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8815b1.wgsl.expected.ir.msl
index 9dd6d504..e6c68bd 100644
--- a/test/tint/builtins/gen/literal/textureStore/8815b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8815b1.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8815b1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8815b1 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8815b1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8815b1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8815b1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8815b1
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8815b1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8815b1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/885921.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/885921.wgsl.expected.ir.msl
index 1679f62..b89b1ee 100644
--- a/test/tint/builtins/gen/literal/textureStore/885921.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/885921.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_885921(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_885921 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_885921(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_885921
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_885921(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_885921
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_885921(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_885921
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/88ce7e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/88ce7e.wgsl.expected.ir.msl
index 177dd5c..787309e 100644
--- a/test/tint/builtins/gen/literal/textureStore/88ce7e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/88ce7e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_88ce7e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_88ce7e = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_88ce7e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_88ce7e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_88ce7e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_88ce7e
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_88ce7e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_88ce7e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a16b0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8a16b0.wgsl.expected.ir.msl
index 5736334..f5f1d97 100644
--- a/test/tint/builtins/gen/literal/textureStore/8a16b0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8a16b0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a16b0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a16b0 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a16b0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8a16b0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a16b0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8a16b0
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a16b0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8a16b0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a46ff.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8a46ff.wgsl.expected.ir.msl
index c62062c..b0bc434 100644
--- a/test/tint/builtins/gen/literal/textureStore/8a46ff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8a46ff.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a46ff(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a46ff = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a46ff(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8a46ff
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a46ff(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8a46ff
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a46ff(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8a46ff
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a85b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8a85b9.wgsl.expected.ir.msl
index 9ca0cf7..2c3a437 100644
--- a/test/tint/builtins/gen/literal/textureStore/8a85b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8a85b9.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a85b9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a85b9 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a85b9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8a85b9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a85b9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8a85b9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a85b9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8a85b9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a8681.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.ir.msl
index f6cda78..9e17c67 100644
--- a/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a8681(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a8681 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a8681(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8a8681
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a8681(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8a8681
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a8681(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8a8681
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8ae0bc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8ae0bc.wgsl.expected.ir.msl
index aee9074..590ed84 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ae0bc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8ae0bc.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8ae0bc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8ae0bc = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ae0bc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8ae0bc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ae0bc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8ae0bc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ae0bc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8ae0bc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8b9310.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl.expected.ir.msl
index 877ebc6..cc2979a 100644
--- a/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8b9310(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8b9310(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8b9310(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8b9310(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl.expected.ir.msl
index 877ebc6..210cbd6 100644
--- a/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8bb287(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8bb287(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8bb287(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8bb287(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl.expected.ir.msl
index 877ebc6..15b868a 100644
--- a/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8c76e9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8c76e9(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8c76e9(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8c76e9(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.ir.msl
index 877ebc6..e37721e 100644
--- a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8cd611(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8cd611(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd611(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd611(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd841.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8cd841.wgsl.expected.ir.msl
index e734118..ff3a067 100644
--- a/test/tint/builtins/gen/literal/textureStore/8cd841.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8cd841.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8cd841(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8cd841 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8cd841(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8cd841
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd841(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8cd841
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd841(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8cd841
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8dc54f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl.expected.ir.msl
index 877ebc6..fd03f05 100644
--- a/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8dc54f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8dc54f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8dc54f(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8dc54f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl.expected.ir.msl
index 877ebc6..22cd859 100644
--- a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8e0479(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8e0479(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8e0479(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8e0479(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ebdc9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8ebdc9.wgsl.expected.ir.msl
index b5c2a12..4be0dfa 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ebdc9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8ebdc9.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8ebdc9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8ebdc9 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ebdc9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_8ebdc9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ebdc9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_8ebdc9
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ebdc9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_8ebdc9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8ed9f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl.expected.ir.msl
index 877ebc6..252178f 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8ed9f8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ed9f8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ed9f8(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ed9f8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl.expected.ir.msl
index 877ebc6..dfeecdf 100644
--- a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8f71a1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8f71a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8f71a1(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8f71a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.ir.msl
index 877ebc6..d915e8f 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8ff674(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ff674(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ff674(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ff674(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/90960e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/90960e.wgsl.expected.ir.msl
index 899f8b4..277ec0b 100644
--- a/test/tint/builtins/gen/literal/textureStore/90960e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/90960e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_90960e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_90960e = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_90960e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_90960e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90960e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_90960e
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90960e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_90960e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/90a553.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/90a553.wgsl.expected.ir.msl
index e233fbe..dc39cad 100644
--- a/test/tint/builtins/gen/literal/textureStore/90a553.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/90a553.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_90a553(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_90a553 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_90a553(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_90a553
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90a553(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_90a553
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90a553(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_90a553
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/958353.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/958353.wgsl.expected.ir.msl
index 877ebc6..1577a14 100644
--- a/test/tint/builtins/gen/literal/textureStore/958353.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/958353.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_958353(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_958353(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_958353(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_958353(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/959d94.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/959d94.wgsl.expected.ir.msl
index 877ebc6..bf0ca3e 100644
--- a/test/tint/builtins/gen/literal/textureStore/959d94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/959d94.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_959d94(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_959d94(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_959d94(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_959d94(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/95e452.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/95e452.wgsl.expected.ir.msl
index 877ebc6..675c514 100644
--- a/test/tint/builtins/gen/literal/textureStore/95e452.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/95e452.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_95e452(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_95e452(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_95e452(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_95e452(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/969534.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/969534.wgsl.expected.ir.msl
index 877ebc6..09b5743 100644
--- a/test/tint/builtins/gen/literal/textureStore/969534.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/969534.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_969534(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_969534(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_969534(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_969534(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/976636.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/976636.wgsl.expected.ir.msl
index cfffe30..5f11ce0 100644
--- a/test/tint/builtins/gen/literal/textureStore/976636.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/976636.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_976636(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_976636 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_976636(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_976636
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_976636(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_976636
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_976636(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_976636
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9938b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.ir.msl
index 877ebc6..a6b19c6 100644
--- a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9938b7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9938b7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9938b7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9938b7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl.expected.ir.msl
index 877ebc6..4d7abaf 100644
--- a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9a3ecc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9a3ecc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9a3ecc(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9a3ecc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl.expected.ir.msl
index 877ebc6..e815b86 100644
--- a/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9aedd3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9aedd3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9aedd3(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9aedd3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9ba5c1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9ba5c1.wgsl.expected.ir.msl
index a25776a..3d9df99 100644
--- a/test/tint/builtins/gen/literal/textureStore/9ba5c1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9ba5c1.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9ba5c1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9ba5c1 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9ba5c1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_9ba5c1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9ba5c1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_9ba5c1
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9ba5c1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_9ba5c1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9cea9e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9cea9e.wgsl.expected.ir.msl
index 5636c1f..5a52c7a 100644
--- a/test/tint/builtins/gen/literal/textureStore/9cea9e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9cea9e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9cea9e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9cea9e = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9cea9e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_9cea9e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9cea9e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_9cea9e
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9cea9e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_9cea9e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9d7c62.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9d7c62.wgsl.expected.ir.msl
index 37bac20..f03a6ce 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d7c62.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9d7c62.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9d7c62(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9d7c62 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d7c62(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_9d7c62
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d7c62(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_9d7c62
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d7c62(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_9d7c62
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9d8668.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.ir.msl
index 877ebc6..f29303e 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9d8668(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d8668(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d8668(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d8668(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl.expected.ir.msl
index 877ebc6..e314753 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9d9cd5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d9cd5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d9cd5(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d9cd5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl.expected.ir.msl
index 877ebc6..cb7ecbf 100644
--- a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9e3ec5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9e3ec5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e3ec5(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e3ec5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.ir.msl
index 877ebc6..1125d11 100644
--- a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9e5bc2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9e5bc2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e5bc2(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e5bc2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.ir.msl
index 877ebc6..478a70e 100644
--- a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9f5318(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9f5318(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f5318(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f5318(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.ir.msl
index 877ebc6..8592bac 100644
--- a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9f7cea(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9f7cea(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f7cea(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f7cea(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a0022f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a0022f.wgsl.expected.ir.msl
index 38a40c9..ded97fd 100644
--- a/test/tint/builtins/gen/literal/textureStore/a0022f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a0022f.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a0022f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a0022f = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a0022f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a0022f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0022f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a0022f
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0022f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a0022f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a0f96e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl.expected.ir.msl
index 877ebc6..5b02a72 100644
--- a/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a0f96e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a0f96e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0f96e(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0f96e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl.expected.ir.msl
index 877ebc6..f46f333 100644
--- a/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a1352c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a1352c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a1352c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a1352c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a14041.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a14041.wgsl.expected.ir.msl
index 0074ea5..93f4d8f 100644
--- a/test/tint/builtins/gen/literal/textureStore/a14041.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a14041.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a14041(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a14041 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a14041(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a14041
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a14041(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a14041
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a14041(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a14041
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a165b8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl.expected.ir.msl
index 877ebc6..d2fed4e 100644
--- a/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a165b8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a165b8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a165b8(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a165b8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a19a12.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a19a12.wgsl.expected.ir.msl
index 75a6be8..de9c1ce 100644
--- a/test/tint/builtins/gen/literal/textureStore/a19a12.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a19a12.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a19a12(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a19a12 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a19a12(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a19a12
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a19a12(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a19a12
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a19a12(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a19a12
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a24491.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a24491.wgsl.expected.ir.msl
index 68fcfad..8179043 100644
--- a/test/tint/builtins/gen/literal/textureStore/a24491.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a24491.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a24491(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a24491 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a24491(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a24491
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a24491(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a24491
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a24491(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a24491
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a4c338.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl.expected.ir.msl
index 877ebc6..1105c52 100644
--- a/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a4c338(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a4c338(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a4c338(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a4c338(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a5b88e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a5b88e.wgsl.expected.ir.msl
index a418b74..9bd6160 100644
--- a/test/tint/builtins/gen/literal/textureStore/a5b88e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a5b88e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a5b88e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a5b88e = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5b88e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a5b88e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5b88e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a5b88e
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5b88e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a5b88e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a5c925.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a5c925.wgsl.expected.ir.msl
index 21f5454..ab40b70 100644
--- a/test/tint/builtins/gen/literal/textureStore/a5c925.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a5c925.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a5c925(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a5c925 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5c925(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a5c925
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5c925(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a5c925
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5c925(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a5c925
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a5e80d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl.expected.ir.msl
index 877ebc6..be7bb28 100644
--- a/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a5e80d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5e80d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5e80d(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5e80d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a66ca4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a66ca4.wgsl.expected.ir.msl
index c4e76fe..a917d23 100644
--- a/test/tint/builtins/gen/literal/textureStore/a66ca4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a66ca4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a66ca4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a66ca4 = func():void {
-  $B2: {
-    %3:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a66ca4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a66ca4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a66ca4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a66ca4
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a66ca4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a66ca4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a6a986.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.ir.msl
index 877ebc6..fc6e5a6 100644
--- a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a6a986(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a6a986(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6a986(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6a986(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl.expected.ir.msl
index 877ebc6..4177035 100644
--- a/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a6e78f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a6e78f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6e78f(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6e78f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.ir.msl
index cef39ea..8c5db72 100644
--- a/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a702b6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a702b6 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a702b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a702b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a702b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a702b6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a702b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a702b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a7fc47.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.ir.msl
index 09e3732..d8713e8 100644
--- a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a7fc47(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a7fc47 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a7fc47(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a7fc47
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a7fc47(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a7fc47
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a7fc47(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a7fc47
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a9298c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.ir.msl
index 8c694b5..00920c4 100644
--- a/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a9298c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a9298c = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a9298c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_a9298c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9298c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_a9298c
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9298c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_a9298c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a9426c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl.expected.ir.msl
index 877ebc6..5d070c1 100644
--- a/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a9426c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a9426c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9426c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9426c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ab03b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ab03b6.wgsl.expected.ir.msl
index a49d67a..80756e5 100644
--- a/test/tint/builtins/gen/literal/textureStore/ab03b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ab03b6.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ab03b6(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ab03b6 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ab03b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ab03b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab03b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ab03b6
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab03b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ab03b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ab788e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.ir.msl
index 81e3ec0..11dbe7a 100644
--- a/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ab788e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ab788e = func():void {
-  $B2: {
-    %3:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ab788e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ab788e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab788e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ab788e
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab788e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ab788e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/abdd21.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/abdd21.wgsl.expected.ir.msl
index 9f68be7..38f07ee 100644
--- a/test/tint/builtins/gen/literal/textureStore/abdd21.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/abdd21.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_abdd21(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_abdd21 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_abdd21(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_abdd21
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_abdd21(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_abdd21
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_abdd21(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_abdd21
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ac0a55.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ac0a55.wgsl.expected.ir.msl
index 09b997d..c397874 100644
--- a/test/tint/builtins/gen/literal/textureStore/ac0a55.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ac0a55.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ac0a55(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ac0a55 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ac0a55(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ac0a55
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac0a55(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ac0a55
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac0a55(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ac0a55
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ac67aa.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.ir.msl
index 877ebc6..b811f13 100644
--- a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ac67aa(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ac67aa(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac67aa(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac67aa(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.ir.msl
index 0bac92e..2ccd301 100644
--- a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ae6a2a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ae6a2a = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ae6a2a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ae6a2a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ae6a2a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ae6a2a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ae6a2a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ae6a2a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/aeb38a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl.expected.ir.msl
index 877ebc6..9dea5e3 100644
--- a/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_aeb38a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_aeb38a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aeb38a(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aeb38a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/aedea3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/aedea3.wgsl.expected.ir.msl
index 1033809..aa7728e 100644
--- a/test/tint/builtins/gen/literal/textureStore/aedea3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/aedea3.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_aedea3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_aedea3 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_aedea3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_aedea3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aedea3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_aedea3
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aedea3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_aedea3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b16110.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b16110.wgsl.expected.ir.msl
index f4fe414..4c10448 100644
--- a/test/tint/builtins/gen/literal/textureStore/b16110.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b16110.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b16110(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b16110 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b16110(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b16110
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b16110(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b16110
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b16110(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b16110
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b286b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b286b4.wgsl.expected.ir.msl
index 2b717c4..5c722b0 100644
--- a/test/tint/builtins/gen/literal/textureStore/b286b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b286b4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b286b4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b286b4 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b286b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b286b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b286b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b286b4
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b286b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b286b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b36bc1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b36bc1.wgsl.expected.ir.msl
index b5586e4..252231c 100644
--- a/test/tint/builtins/gen/literal/textureStore/b36bc1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b36bc1.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b36bc1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b36bc1 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b36bc1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b36bc1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b36bc1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b36bc1
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b36bc1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b36bc1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b42fd3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl.expected.ir.msl
index 877ebc6..5ccde89 100644
--- a/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b42fd3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b42fd3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b42fd3(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b42fd3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b4389e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b4389e.wgsl.expected.ir.msl
index c59af0a..29d85b2 100644
--- a/test/tint/builtins/gen/literal/textureStore/b4389e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b4389e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b4389e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b4389e = func():void {
-  $B2: {
-    %3:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b4389e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b4389e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b4389e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b4389e
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b4389e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b4389e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b706b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl.expected.ir.msl
index 877ebc6..a8e7a99 100644
--- a/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b706b1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b706b1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b706b1(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b706b1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl.expected.ir.msl
index 877ebc6..46f065f 100644
--- a/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b70ded(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b70ded(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b70ded(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b70ded(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.ir.msl
index 09885a5..dd7abeb 100644
--- a/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b71c13(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b71c13 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b71c13(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b71c13
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b71c13(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b71c13
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b71c13(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b71c13
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b7232c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b7232c.wgsl.expected.ir.msl
index f636376..e49cbbd 100644
--- a/test/tint/builtins/gen/literal/textureStore/b7232c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b7232c.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b7232c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b7232c = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b7232c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b7232c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b7232c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b7232c
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b7232c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b7232c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b76ff3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl.expected.ir.msl
index 877ebc6..48f10f6 100644
--- a/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b76ff3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b76ff3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b76ff3(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b76ff3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.ir.msl
index 877ebc6..3c5432b 100644
--- a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b77161(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b77161(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b77161(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b77161(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b89ffb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b89ffb.wgsl.expected.ir.msl
index 4c2e579..f8788c8 100644
--- a/test/tint/builtins/gen/literal/textureStore/b89ffb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b89ffb.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b89ffb(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b89ffb = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b89ffb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b89ffb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b89ffb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b89ffb
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b89ffb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b89ffb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b91b86.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.ir.msl
index 877ebc6..11cf8f2 100644
--- a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b91b86(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b91b86(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b91b86(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b91b86(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.ir.msl
index ae15d5e..26ee0ce 100644
--- a/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b9c81a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b9c81a = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b9c81a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b9c81a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9c81a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b9c81a
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9c81a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b9c81a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b9d863.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/b9d863.wgsl.expected.ir.msl
index 12cd07f..819ee64 100644
--- a/test/tint/builtins/gen/literal/textureStore/b9d863.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/b9d863.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b9d863(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b9d863 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b9d863(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_b9d863
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9d863(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_b9d863
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9d863(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_b9d863
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bbcb7f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl.expected.ir.msl
index 877ebc6..0216838 100644
--- a/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bbcb7f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bbcb7f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bbcb7f(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bbcb7f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/bc1423.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bc1423.wgsl.expected.ir.msl
index d3cdf75..27deb82 100644
--- a/test/tint/builtins/gen/literal/textureStore/bc1423.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bc1423.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bc1423(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bc1423 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bc1423(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_bc1423
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bc1423(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_bc1423
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bc1423(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_bc1423
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bcc97a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bcc97a.wgsl.expected.ir.msl
index a09afd9..70324df 100644
--- a/test/tint/builtins/gen/literal/textureStore/bcc97a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bcc97a.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bcc97a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bcc97a = func():void {
-  $B2: {
-    %3:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bcc97a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_bcc97a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bcc97a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_bcc97a
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bcc97a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_bcc97a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bd6602.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.ir.msl
index 97b7f93..2ac7e10 100644
--- a/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bd6602(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bd6602 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bd6602(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_bd6602
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bd6602(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_bd6602
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bd6602(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_bd6602
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/be6e30.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl.expected.ir.msl
index 877ebc6..143bb4e 100644
--- a/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_be6e30(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_be6e30(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_be6e30(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_be6e30(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl.expected.ir.msl
index 877ebc6..34f8672 100644
--- a/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bedbfc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bedbfc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bedbfc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bedbfc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl.expected.ir.msl
index 877ebc6..76c66d9 100644
--- a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bf775c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bf775c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bf775c(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bf775c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c06463.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c06463.wgsl.expected.ir.msl
index fe4ca3e..fdf8a34 100644
--- a/test/tint/builtins/gen/literal/textureStore/c06463.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c06463.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c06463(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c06463 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c06463(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c06463
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c06463(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c06463
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c06463(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c06463
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c1c664.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c1c664.wgsl.expected.ir.msl
index 42882cb..b233bdc 100644
--- a/test/tint/builtins/gen/literal/textureStore/c1c664.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c1c664.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c1c664(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c1c664 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1c664(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c1c664
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1c664(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c1c664
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1c664(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c1c664
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c1f29e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl.expected.ir.msl
index 877ebc6..7e0c2c4 100644
--- a/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c1f29e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1f29e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f29e(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f29e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c1f760.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c1f760.wgsl.expected.ir.msl
index f911f3e..404b9ab 100644
--- a/test/tint/builtins/gen/literal/textureStore/c1f760.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c1f760.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c1f760(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c1f760 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1f760(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c1f760
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f760(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c1f760
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f760(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c1f760
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c2ca46.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl.expected.ir.msl
index 877ebc6..5095f14 100644
--- a/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c2ca46(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c2ca46(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c2ca46(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c2ca46(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.ir.msl
index 877ebc6..2f7e9cb 100644
--- a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c32905(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c32905(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c32905(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c32905(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.ir.msl
index 22e7a69..94bcc47 100644
--- a/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c33478(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c33478 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c33478(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c33478
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c33478(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c33478
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c33478(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c33478
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c35268.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c35268.wgsl.expected.ir.msl
index f80f8cd..b57bc82 100644
--- a/test/tint/builtins/gen/literal/textureStore/c35268.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c35268.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c35268(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c35268 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c35268(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c35268
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c35268(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c35268
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c35268(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c35268
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c5af1e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl.expected.ir.msl
index 877ebc6..23d7d30 100644
--- a/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c5af1e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c5af1e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c5af1e(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c5af1e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c63f05.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c63f05.wgsl.expected.ir.msl
index a24e662..81f4ff1 100644
--- a/test/tint/builtins/gen/literal/textureStore/c63f05.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c63f05.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c63f05(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c63f05 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c63f05(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c63f05
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c63f05(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c63f05
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c63f05(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c63f05
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c79451.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c79451.wgsl.expected.ir.msl
index 198956e..d644bf6 100644
--- a/test/tint/builtins/gen/literal/textureStore/c79451.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c79451.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c79451(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c79451 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c79451(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_c79451
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c79451(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_c79451
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c79451(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_c79451
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c863be.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.ir.msl
index 877ebc6..acff77b 100644
--- a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c863be(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c863be(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c863be(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c863be(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl.expected.ir.msl
index 877ebc6..aeebdf7 100644
--- a/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c9d780(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c9d780(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c9d780(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c9d780(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl.expected.ir.msl
index 877ebc6..79bd513 100644
--- a/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_cb3b0b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_cb3b0b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cb3b0b(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cb3b0b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ccac20.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ccac20.wgsl.expected.ir.msl
index b35917d..21a5546 100644
--- a/test/tint/builtins/gen/literal/textureStore/ccac20.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ccac20.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ccac20(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ccac20 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ccac20(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ccac20
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ccac20(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ccac20
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ccac20(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ccac20
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/cd6755.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl.expected.ir.msl
index 877ebc6..ee18ddb 100644
--- a/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_cd6755(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_cd6755(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cd6755(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cd6755(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ceb832.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ceb832.wgsl.expected.ir.msl
index 4bd44f7..372c2be 100644
--- a/test/tint/builtins/gen/literal/textureStore/ceb832.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ceb832.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ceb832(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ceb832 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ceb832(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ceb832
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ceb832(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ceb832
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ceb832(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ceb832
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d0d62c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d0d62c.wgsl.expected.ir.msl
index 2c0c22a..f4b4dae 100644
--- a/test/tint/builtins/gen/literal/textureStore/d0d62c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d0d62c.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d0d62c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d0d62c = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d0d62c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d0d62c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0d62c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d0d62c
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0d62c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d0d62c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d0fadc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d0fadc.wgsl.expected.ir.msl
index 9e45831..ba82353 100644
--- a/test/tint/builtins/gen/literal/textureStore/d0fadc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d0fadc.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d0fadc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d0fadc = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d0fadc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d0fadc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0fadc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d0fadc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0fadc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d0fadc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d19db4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.ir.msl
index 52ec638..631eaef 100644
--- a/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d19db4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d19db4 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d19db4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d19db4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d19db4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d19db4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d19db4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d19db4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d1ab82.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d1ab82.wgsl.expected.ir.msl
index de4d75b..18ac934 100644
--- a/test/tint/builtins/gen/literal/textureStore/d1ab82.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d1ab82.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d1ab82(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d1ab82 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d1ab82(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d1ab82
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d1ab82(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d1ab82
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d1ab82(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d1ab82
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d26166.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d26166.wgsl.expected.ir.msl
index 877ebc6..710e932 100644
--- a/test/tint/builtins/gen/literal/textureStore/d26166.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d26166.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d26166(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d26166(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d26166(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d26166(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl.expected.ir.msl
index 877ebc6..f23ae07 100644
--- a/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d2b565(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d2b565(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d2b565(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d2b565(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d3a22b.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d3a22b.wgsl.expected.ir.msl
index 4bc5fe7..90ed330 100644
--- a/test/tint/builtins/gen/literal/textureStore/d3a22b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d3a22b.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d3a22b(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d3a22b = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d3a22b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d3a22b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d3a22b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d3a22b
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d3a22b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d3a22b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d4aa95.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl.expected.ir.msl
index 877ebc6..282b0d7 100644
--- a/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d4aa95(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d4aa95(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d4aa95(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d4aa95(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.ir.msl
index 877ebc6..34514d6 100644
--- a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d55e65(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d55e65(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d55e65(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d55e65(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.ir.msl
index 877ebc6..bb4f03e 100644
--- a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d73b5c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d73b5c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d73b5c(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d73b5c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.ir.msl
index 877ebc6..68097ca 100644
--- a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d82b0a(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d82b0a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d82b0a(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d82b0a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d86d33.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/d86d33.wgsl.expected.ir.msl
index cd4ad3a..0f4cd66 100644
--- a/test/tint/builtins/gen/literal/textureStore/d86d33.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/d86d33.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d86d33(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d86d33 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d86d33(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_d86d33
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d86d33(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_d86d33
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d86d33(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_d86d33
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/da530c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/da530c.wgsl.expected.ir.msl
index e966878..20a5d16 100644
--- a/test/tint/builtins/gen/literal/textureStore/da530c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/da530c.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_da530c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_da530c = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_da530c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_da530c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_da530c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_da530c
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_da530c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_da530c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/db5128.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/db5128.wgsl.expected.ir.msl
index 6ab468a..c9c87e8 100644
--- a/test/tint/builtins/gen/literal/textureStore/db5128.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/db5128.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_db5128(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_db5128 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_db5128(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_db5128
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db5128(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_db5128
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db5128(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_db5128
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/db92a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl.expected.ir.msl
index 877ebc6..051eb9c 100644
--- a/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_db92a2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_db92a2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db92a2(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db92a2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dce0e2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dce0e2.wgsl.expected.ir.msl
index 6ee0143..cf99a73 100644
--- a/test/tint/builtins/gen/literal/textureStore/dce0e2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dce0e2.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_dce0e2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_dce0e2 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dce0e2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_dce0e2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dce0e2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_dce0e2
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dce0e2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_dce0e2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/dd7d81.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl.expected.ir.msl
index 877ebc6..02a6ceb 100644
--- a/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dd7d81(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dd7d81(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd7d81(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd7d81(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dd8b29.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dd8b29.wgsl.expected.ir.msl
index 3d23822..f079be2 100644
--- a/test/tint/builtins/gen/literal/textureStore/dd8b29.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dd8b29.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_dd8b29(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_dd8b29 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dd8b29(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_dd8b29
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd8b29(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_dd8b29
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd8b29(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_dd8b29
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/dde364.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.ir.msl
index 877ebc6..69e2a29 100644
--- a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dde364(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dde364(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dde364(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dde364(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/de38e5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/de38e5.wgsl.expected.ir.msl
index 65c1671..620e24c 100644
--- a/test/tint/builtins/gen/literal/textureStore/de38e5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/de38e5.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_de38e5(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_de38e5 = func():void {
-  $B2: {
-    %3:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_de38e5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_de38e5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de38e5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_de38e5
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de38e5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_de38e5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/de4b94.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl.expected.ir.msl
index 877ebc6..2a2387f 100644
--- a/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_de4b94(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_de4b94(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de4b94(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de4b94(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df0c51.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/df0c51.wgsl.expected.ir.msl
index d0105fc..df3bba1 100644
--- a/test/tint/builtins/gen/literal/textureStore/df0c51.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/df0c51.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_df0c51(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_df0c51 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<u32>(1u), vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_df0c51(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_df0c51
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df0c51(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_df0c51
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df0c51(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_df0c51
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/df2ca4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.ir.msl
index 877ebc6..9126cd7 100644
--- a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_df2ca4(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_df2ca4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df2ca4(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df2ca4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.ir.msl
index 877ebc6..3eeccd0 100644
--- a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dfa9a1(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dfa9a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dfa9a1(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dfa9a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.ir.msl
index 877ebc6..668e6b0 100644
--- a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dffb13(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dffb13(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dffb13(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dffb13(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.ir.msl
index 0ceadf3..8f5554b 100644
--- a/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e077e7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e077e7 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e077e7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_e077e7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e077e7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_e077e7
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e077e7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_e077e7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e0b666.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl.expected.ir.msl
index 877ebc6..0c6fb070 100644
--- a/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e0b666(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e0b666(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e0b666(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e0b666(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/e1784d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e1784d.wgsl.expected.ir.msl
index da82960..335a568 100644
--- a/test/tint/builtins/gen/literal/textureStore/e1784d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e1784d.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e1784d(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e1784d = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e1784d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_e1784d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e1784d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_e1784d
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e1784d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_e1784d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e38281.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e38281.wgsl.expected.ir.msl
index 877ebc6..f9c6f09 100644
--- a/test/tint/builtins/gen/literal/textureStore/e38281.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e38281.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e38281(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e38281(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e38281(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e38281(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/e46fd8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e46fd8.wgsl.expected.ir.msl
index d0c8fc1..165aa69 100644
--- a/test/tint/builtins/gen/literal/textureStore/e46fd8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e46fd8.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e46fd8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e46fd8 = func():void {
-  $B2: {
-    %3:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e46fd8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_e46fd8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e46fd8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_e46fd8
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e46fd8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_e46fd8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e72bdc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e72bdc.wgsl.expected.ir.msl
index 405c746..b0029d9 100644
--- a/test/tint/builtins/gen/literal/textureStore/e72bdc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e72bdc.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e72bdc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e72bdc = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e72bdc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_e72bdc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e72bdc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_e72bdc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e72bdc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_e72bdc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e7c6d8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl.expected.ir.msl
index 877ebc6..5ff4c12 100644
--- a/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e7c6d8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e7c6d8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e7c6d8(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e7c6d8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/e87f6e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e87f6e.wgsl.expected.ir.msl
index 0dd0320..6f69074 100644
--- a/test/tint/builtins/gen/literal/textureStore/e87f6e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e87f6e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e87f6e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e87f6e = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e87f6e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_e87f6e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e87f6e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_e87f6e
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e87f6e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_e87f6e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e885e8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl.expected.ir.msl
index 877ebc6..40a3f8e 100644
--- a/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e885e8(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e885e8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e885e8(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e885e8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl.expected.ir.msl
index 877ebc6..85f5282 100644
--- a/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e8cbf7(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e8cbf7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e8cbf7(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e8cbf7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.ir.msl
index f5ad660..d83ddf6 100644
--- a/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ea30d2(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ea30d2 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ea30d2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ea30d2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ea30d2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ea30d2
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ea30d2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ea30d2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/eb702f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl.expected.ir.msl
index 877ebc6..5ba4604 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_eb702f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_eb702f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb702f(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb702f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl.expected.ir.msl
index 877ebc6..42237d3 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_eb78b9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_eb78b9(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb78b9(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb78b9(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.ir.msl
index d466bd5..c77a5dc 100644
--- a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ed6198(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ed6198 = func():void {
-  $B2: {
-    %3:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec3<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ed6198(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ed6198
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ed6198(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ed6198
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ed6198(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ed6198
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ee6acc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.ir.msl
index 877ebc6..b2686f5 100644
--- a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ee6acc(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ee6acc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ee6acc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ee6acc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl.expected.ir.msl
index 877ebc6..099b568 100644
--- a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ef9f2f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ef9f2f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ef9f2f(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ef9f2f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f05928.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f05928.wgsl.expected.ir.msl
index 012fee8..e6478f3 100644
--- a/test/tint/builtins/gen/literal/textureStore/f05928.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f05928.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f05928(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1u);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f05928 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1u, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f05928(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_f05928
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f05928(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_f05928
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f05928(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_f05928
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f1e6d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl.expected.ir.msl
index 877ebc6..2e0f295 100644
--- a/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f1e6d3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f1e6d3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f1e6d3(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f1e6d3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f64d69.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f64d69.wgsl.expected.ir.msl
index e3c57ac..bb78c6b 100644
--- a/test/tint/builtins/gen/literal/textureStore/f64d69.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f64d69.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f64d69(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f64d69 = func():void {
-  $B2: {
-    %3:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f64d69(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_f64d69
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f64d69(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_f64d69
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f64d69(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_f64d69
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f6f392.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f6f392.wgsl.expected.ir.msl
index 89a285b..f2ff675 100644
--- a/test/tint/builtins/gen/literal/textureStore/f6f392.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f6f392.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f6f392(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f6f392 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f6f392(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_f6f392
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f6f392(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_f6f392
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f6f392(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_f6f392
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f7b0ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.ir.msl
index 877ebc6..12afb61 100644
--- a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f7b0ab(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f7b0ab(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f7b0ab(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f7b0ab(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f8aaf9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f8aaf9.wgsl.expected.ir.msl
index 8e36399..6bdfd06 100644
--- a/test/tint/builtins/gen/literal/textureStore/f8aaf9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f8aaf9.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f8aaf9(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f8aaf9 = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), 1i, vec4<i32>(1i)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f8aaf9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_f8aaf9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8aaf9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_f8aaf9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8aaf9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_f8aaf9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f8dead.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl.expected.ir.msl
index 877ebc6..7035708 100644
--- a/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f8dead(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint3(int3(1)));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f8dead(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8dead(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8dead(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f975a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f975a0.wgsl.expected.ir.msl
index 8ac603b..949c3fe 100644
--- a/test/tint/builtins/gen/literal/textureStore/f975a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f975a0.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f975a0(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint2(int2(1)));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f975a0 = func():void {
-  $B2: {
-    %3:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<i32>(1i), vec4<f32>(1.0f)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f975a0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_f975a0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f975a0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_f975a0
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f975a0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_f975a0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f9be83.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.ir.msl
index 877ebc6..b2245e1 100644
--- a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f9be83(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f9be83(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f9be83(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f9be83(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl.expected.ir.msl
index 877ebc6..c808eac 100644
--- a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fb9a8f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fb9a8f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fb9a8f(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fb9a8f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl.expected.ir.msl
index 877ebc6..c284231 100644
--- a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fbf53f(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(int4(1), uint2(int2(1)), 1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fbf53f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fbf53f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fbf53f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fc916e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/fc916e.wgsl.expected.ir.msl
index cc3903b..8fa222f 100644
--- a/test/tint/builtins/gen/literal/textureStore/fc916e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/fc916e.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_fc916e(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(1u), 1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_fc916e = func():void {
-  $B2: {
-    %3:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %4:void = textureStore %3, vec2<u32>(1u), 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fc916e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_fc916e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fc916e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_fc916e
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fc916e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_fc916e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/fcbe66.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.ir.msl
index 877ebc6..6b66abc 100644
--- a/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fcbe66(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(float4(1.0f), uint3(1u));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fcbe66(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fcbe66(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fcbe66(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.ir.msl
index 877ebc6..530d045 100644
--- a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.ir.msl
@@ -1,9 +1,28 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fd350c(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint2(int2(1)), 1u);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fd350c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fd350c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fd350c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ff23b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureStore/ff23b3.wgsl.expected.ir.msl
index da43bcf..e776716 100644
--- a/test/tint/builtins/gen/literal/textureStore/ff23b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureStore/ff23b3.wgsl.expected.ir.msl
@@ -1,39 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ff23b3(tint_module_vars_struct tint_module_vars) {
+  tint_module_vars.arg_0.write(uint4(1u), uint(1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ff23b3 = func():void {
-  $B2: {
-    %3:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %4:void = textureStore %3, 1i, vec4<u32>(1u)
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ff23b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %6:void = call %textureStore_ff23b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ff23b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %8:void = call %textureStore_ff23b3
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ff23b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %10:void = call %textureStore_ff23b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/00ca64.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/00ca64.wgsl.expected.ir.msl
index 877ebc6..3689f66 100644
--- a/test/tint/builtins/gen/var/textureStore/00ca64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/00ca64.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_00ca64(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_00ca64(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_00ca64(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_00ca64(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0148bd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0148bd.wgsl.expected.ir.msl
index 877ebc6..18fd205 100644
--- a/test/tint/builtins/gen/var/textureStore/0148bd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0148bd.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0148bd(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0148bd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0148bd(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0148bd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/031506.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/031506.wgsl.expected.ir.msl
index 1a9f15b..e033538 100644
--- a/test/tint/builtins/gen/var/textureStore/031506.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/031506.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_031506(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_031506 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<r32float, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_031506(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_031506
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_031506(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_031506
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_031506(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_031506
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/036d0e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/036d0e.wgsl.expected.ir.msl
index 770b286..4871e4a 100644
--- a/test/tint/builtins/gen/var/textureStore/036d0e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/036d0e.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_036d0e(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_036d0e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_036d0e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_036d0e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_036d0e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_036d0e
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_036d0e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_036d0e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/03e7a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/03e7a0.wgsl.expected.ir.msl
index 49adaf9..7c17ac4 100644
--- a/test/tint/builtins/gen/var/textureStore/03e7a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/03e7a0.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_03e7a0(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_03e7a0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_03e7a0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_03e7a0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_03e7a0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_03e7a0
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_03e7a0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_03e7a0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/042b06.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/042b06.wgsl.expected.ir.msl
index cd6458a..57623c1 100644
--- a/test/tint/builtins/gen/var/textureStore/042b06.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/042b06.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_042b06(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_042b06 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_042b06(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_042b06
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_042b06(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_042b06
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_042b06(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_042b06
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/052a4e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/052a4e.wgsl.expected.ir.msl
index dd07330..eb92932 100644
--- a/test/tint/builtins/gen/var/textureStore/052a4e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/052a4e.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_052a4e(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_052a4e = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_052a4e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_052a4e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_052a4e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_052a4e
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_052a4e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_052a4e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/053664.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/053664.wgsl.expected.ir.msl
index 5f306fb..07945bf 100644
--- a/test/tint/builtins/gen/var/textureStore/053664.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/053664.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_053664(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_053664 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_053664(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_053664
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_053664(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_053664
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_053664(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_053664
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/05ce15.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/05ce15.wgsl.expected.ir.msl
index 877ebc6..6ad9f14 100644
--- a/test/tint/builtins/gen/var/textureStore/05ce15.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/05ce15.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_05ce15(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_05ce15(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_05ce15(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_05ce15(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.ir.msl
index 877ebc6..b9150a8 100644
--- a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_064c7f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_064c7f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_064c7f(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_064c7f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/068641.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/068641.wgsl.expected.ir.msl
index 877ebc6..14fbab9 100644
--- a/test/tint/builtins/gen/var/textureStore/068641.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/068641.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_068641(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_068641(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_068641(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_068641(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/06e49c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/06e49c.wgsl.expected.ir.msl
index 877ebc6..7e0a730 100644
--- a/test/tint/builtins/gen/var/textureStore/06e49c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/06e49c.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_06e49c(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_06e49c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_06e49c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_06e49c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/07548b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/07548b.wgsl.expected.ir.msl
index 877ebc6..a5ec7d5 100644
--- a/test/tint/builtins/gen/var/textureStore/07548b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/07548b.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_07548b(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_07548b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_07548b(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_07548b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/09e4d5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/09e4d5.wgsl.expected.ir.msl
index 3a40e3a..850e824 100644
--- a/test/tint/builtins/gen/var/textureStore/09e4d5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/09e4d5.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_09e4d5(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_09e4d5 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_09e4d5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_09e4d5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_09e4d5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_09e4d5
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_09e4d5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_09e4d5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0a1a79.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl.expected.ir.msl
index 877ebc6..ee73925 100644
--- a/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0a1a79(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0a1a79(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0a1a79(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0a1a79(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.ir.msl
index 0d98c68..61a01e9 100644
--- a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ad124(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ad124 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ad124(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_0ad124
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ad124(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_0ad124
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ad124(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_0ad124
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0ade9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.ir.msl
index b810d24..2f7a64e 100644
--- a/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ade9a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ade9a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ade9a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_0ade9a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ade9a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_0ade9a
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ade9a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_0ade9a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/0af6b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl.expected.ir.msl
index 877ebc6..30b73d9 100644
--- a/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0af6b5(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0af6b5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0af6b5(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0af6b5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl.expected.ir.msl
index 877ebc6..72e8c27 100644
--- a/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0c3dff(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0c3dff(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0c3dff(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0c3dff(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0cc825.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0cc825.wgsl.expected.ir.msl
index 877ebc6..b11cbf8 100644
--- a/test/tint/builtins/gen/var/textureStore/0cc825.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0cc825.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_0cc825(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0cc825(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0cc825(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0cc825(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ff97a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/0ff97a.wgsl.expected.ir.msl
index 8222399..0e738d8 100644
--- a/test/tint/builtins/gen/var/textureStore/0ff97a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/0ff97a.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_0ff97a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_0ff97a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_0ff97a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_0ff97a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ff97a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_0ff97a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_0ff97a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_0ff97a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/101325.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/101325.wgsl.expected.ir.msl
index 52e456f..27b6b40 100644
--- a/test/tint/builtins/gen/var/textureStore/101325.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/101325.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_101325(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_101325 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_101325(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_101325
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_101325(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_101325
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_101325(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_101325
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/102722.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/102722.wgsl.expected.ir.msl
index 877ebc6..c03e129 100644
--- a/test/tint/builtins/gen/var/textureStore/102722.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/102722.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_102722(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_102722(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_102722(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_102722(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/145061.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/145061.wgsl.expected.ir.msl
index 0048053..fc26cfb 100644
--- a/test/tint/builtins/gen/var/textureStore/145061.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/145061.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_145061(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_145061 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_145061(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_145061
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_145061(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_145061
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_145061(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_145061
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/158cf0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/158cf0.wgsl.expected.ir.msl
index 877ebc6..707a48a 100644
--- a/test/tint/builtins/gen/var/textureStore/158cf0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/158cf0.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_158cf0(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_158cf0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_158cf0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_158cf0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/178e69.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/178e69.wgsl.expected.ir.msl
index 9c29733..37c7bbc 100644
--- a/test/tint/builtins/gen/var/textureStore/178e69.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/178e69.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_178e69(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_178e69 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_178e69(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_178e69
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_178e69(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_178e69
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_178e69(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_178e69
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1839f2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1839f2.wgsl.expected.ir.msl
index 877ebc6..aa6b9d8 100644
--- a/test/tint/builtins/gen/var/textureStore/1839f2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1839f2.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1839f2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1839f2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1839f2(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1839f2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/195d1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/195d1b.wgsl.expected.ir.msl
index e19a985..7f25945 100644
--- a/test/tint/builtins/gen/var/textureStore/195d1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/195d1b.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_195d1b(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_195d1b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_195d1b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_195d1b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_195d1b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_195d1b
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_195d1b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_195d1b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/197637.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/197637.wgsl.expected.ir.msl
index cea31e8..4d45bdd 100644
--- a/test/tint/builtins/gen/var/textureStore/197637.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/197637.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_197637(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_197637 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_197637(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_197637
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_197637(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_197637
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_197637(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_197637
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1a264d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.ir.msl
index 877ebc6..a2eedbc 100644
--- a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1a264d(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a264d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a264d(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a264d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.ir.msl
index 0cdb6f7..93ed6b8 100644
--- a/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1a6c0b(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1a6c0b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a6c0b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_1a6c0b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a6c0b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_1a6c0b
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a6c0b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_1a6c0b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1a7d35.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl.expected.ir.msl
index 877ebc6..a385f15 100644
--- a/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1a7d35(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1a7d35(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a7d35(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1a7d35(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1af236.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1af236.wgsl.expected.ir.msl
index 4637a26..fe0040e 100644
--- a/test/tint/builtins/gen/var/textureStore/1af236.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1af236.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1af236(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1af236 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1af236(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_1af236
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1af236(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_1af236
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1af236(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_1af236
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1bbd08.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl.expected.ir.msl
index 877ebc6..457ebdc 100644
--- a/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1bbd08(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1bbd08(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1bbd08(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1bbd08(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl.expected.ir.msl
index 877ebc6..9625918 100644
--- a/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1c02e7(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1c02e7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1c02e7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1c02e7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1dc954.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1dc954.wgsl.expected.ir.msl
index 877ebc6..038e0a3 100644
--- a/test/tint/builtins/gen/var/textureStore/1dc954.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1dc954.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1dc954(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1dc954(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1dc954(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1dc954(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl.expected.ir.msl
index 877ebc6..14bdab0 100644
--- a/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1e20f2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e20f2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e20f2(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e20f2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.ir.msl
index 877ebc6..40c7294 100644
--- a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1e79f0(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e79f0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e79f0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e79f0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e9fbd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1e9fbd.wgsl.expected.ir.msl
index 8dbedec..5973890 100644
--- a/test/tint/builtins/gen/var/textureStore/1e9fbd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1e9fbd.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1e9fbd(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1e9fbd = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1e9fbd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_1e9fbd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e9fbd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_1e9fbd
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1e9fbd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_1e9fbd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/1efc36.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1efc36.wgsl.expected.ir.msl
index 877ebc6..bfa2f1e 100644
--- a/test/tint/builtins/gen/var/textureStore/1efc36.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1efc36.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1efc36(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1efc36(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1efc36(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1efc36(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl.expected.ir.msl
index 877ebc6..f2ca81e 100644
--- a/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_1f1ef8(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1f1ef8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1f1ef8(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1f1ef8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1fef04.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/1fef04.wgsl.expected.ir.msl
index a03a8b97..2e2fb86 100644
--- a/test/tint/builtins/gen/var/textureStore/1fef04.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/1fef04.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_1fef04(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_1fef04 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_1fef04(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_1fef04
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1fef04(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_1fef04
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_1fef04(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_1fef04
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2046db.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2046db.wgsl.expected.ir.msl
index e1856f1..ef1213f 100644
--- a/test/tint/builtins/gen/var/textureStore/2046db.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2046db.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2046db(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2046db = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2046db(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_2046db
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2046db(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_2046db
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2046db(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_2046db
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/207fdd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/207fdd.wgsl.expected.ir.msl
index 877ebc6..ffff502 100644
--- a/test/tint/builtins/gen/var/textureStore/207fdd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/207fdd.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_207fdd(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_207fdd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_207fdd(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_207fdd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2173fd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2173fd.wgsl.expected.ir.msl
index eed9603..3319bf5 100644
--- a/test/tint/builtins/gen/var/textureStore/2173fd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2173fd.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2173fd(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2173fd = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2173fd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_2173fd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2173fd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_2173fd
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2173fd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_2173fd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/22d955.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/22d955.wgsl.expected.ir.msl
index 877ebc6..607bae4 100644
--- a/test/tint/builtins/gen/var/textureStore/22d955.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/22d955.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_22d955(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_22d955(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22d955(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22d955(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/22f045.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/22f045.wgsl.expected.ir.msl
index 877ebc6..e8771a8 100644
--- a/test/tint/builtins/gen/var/textureStore/22f045.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/22f045.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_22f045(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_22f045(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22f045(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_22f045(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2383fc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2383fc.wgsl.expected.ir.msl
index 877ebc6..65c81f3 100644
--- a/test/tint/builtins/gen/var/textureStore/2383fc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2383fc.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2383fc(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2383fc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2383fc(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2383fc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/24e6b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/24e6b7.wgsl.expected.ir.msl
index 24c6eac..97d7931 100644
--- a/test/tint/builtins/gen/var/textureStore/24e6b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/24e6b7.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_24e6b7(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_24e6b7 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_24e6b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_24e6b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_24e6b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_24e6b7
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_24e6b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_24e6b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/258ab0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/258ab0.wgsl.expected.ir.msl
index 877ebc6..fd042cb 100644
--- a/test/tint/builtins/gen/var/textureStore/258ab0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/258ab0.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_258ab0(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_258ab0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_258ab0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_258ab0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/26a26d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/26a26d.wgsl.expected.ir.msl
index 14a1c69..1dbd9f9 100644
--- a/test/tint/builtins/gen/var/textureStore/26a26d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/26a26d.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_26a26d(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_26a26d = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_26a26d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_26a26d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26a26d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_26a26d
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26a26d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_26a26d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/26bf70.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/26bf70.wgsl.expected.ir.msl
index 877ebc6..298318c 100644
--- a/test/tint/builtins/gen/var/textureStore/26bf70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/26bf70.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_26bf70(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_26bf70(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26bf70(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_26bf70(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/27063a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/27063a.wgsl.expected.ir.msl
index 877ebc6..d8b6870 100644
--- a/test/tint/builtins/gen/var/textureStore/27063a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/27063a.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_27063a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_27063a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_27063a(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_27063a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.ir.msl
index eb6f06b..518dd6a 100644
--- a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_272f5a(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_272f5a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_272f5a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_272f5a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_272f5a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_272f5a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_272f5a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_272f5a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2796b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.ir.msl
index 877ebc6..1735c76 100644
--- a/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2796b4(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2796b4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2796b4(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2796b4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/285218.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/285218.wgsl.expected.ir.msl
index 877ebc6..913baf0 100644
--- a/test/tint/builtins/gen/var/textureStore/285218.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/285218.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_285218(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_285218(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_285218(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_285218(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl.expected.ir.msl
index 877ebc6..47c79b7 100644
--- a/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_28a7ec(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_28a7ec(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28a7ec(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28a7ec(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/28e109.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/28e109.wgsl.expected.ir.msl
index 232c6c1..1b86be6 100644
--- a/test/tint/builtins/gen/var/textureStore/28e109.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/28e109.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_28e109(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_28e109 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_28e109(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_28e109
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28e109(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_28e109
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_28e109(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_28e109
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2a60c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2a60c9.wgsl.expected.ir.msl
index 28cb358..d53f4c5 100644
--- a/test/tint/builtins/gen/var/textureStore/2a60c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2a60c9.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2a60c9(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2a60c9 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2a60c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_2a60c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2a60c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_2a60c9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2a60c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_2a60c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2ac6c7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl.expected.ir.msl
index 877ebc6..3fc3f3f 100644
--- a/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2ac6c7(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2ac6c7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ac6c7(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ac6c7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2addd6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2addd6.wgsl.expected.ir.msl
index 6a12ad7..6a1e9ca 100644
--- a/test/tint/builtins/gen/var/textureStore/2addd6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2addd6.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2addd6(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2addd6 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2addd6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_2addd6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2addd6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_2addd6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2addd6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_2addd6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2c76db.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2c76db.wgsl.expected.ir.msl
index 19654fb..ae6e0c0 100644
--- a/test/tint/builtins/gen/var/textureStore/2c76db.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2c76db.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2c76db(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2c76db = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2c76db(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_2c76db
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2c76db(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_2c76db
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2c76db(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_2c76db
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2d2835.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.ir.msl
index 877ebc6..9a2ec15 100644
--- a/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2d2835(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2d2835(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2d2835(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2d2835(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2e4245.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2e4245.wgsl.expected.ir.msl
index 877ebc6..efd8ef6 100644
--- a/test/tint/builtins/gen/var/textureStore/2e4245.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2e4245.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2e4245(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e4245(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e4245(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e4245(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.ir.msl
index 6eacff7..2f69087 100644
--- a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2e512f(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2e512f = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e512f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_2e512f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e512f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_2e512f
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e512f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_2e512f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/2e6102.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2e6102.wgsl.expected.ir.msl
index 877ebc6..b5b7620 100644
--- a/test/tint/builtins/gen/var/textureStore/2e6102.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2e6102.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2e6102(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2e6102(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e6102(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2e6102(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl.expected.ir.msl
index 877ebc6..012538a 100644
--- a/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2eb2a4(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2eb2a4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2eb2a4(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2eb2a4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl.expected.ir.msl
index 877ebc6..a68dfed 100644
--- a/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_2ed2a3(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2ed2a3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ed2a3(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2ed2a3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2f29ea.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/2f29ea.wgsl.expected.ir.msl
index 054d228..020e66b 100644
--- a/test/tint/builtins/gen/var/textureStore/2f29ea.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/2f29ea.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_2f29ea(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_2f29ea = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_2f29ea(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_2f29ea
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2f29ea(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_2f29ea
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_2f29ea(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_2f29ea
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/30b0b0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl.expected.ir.msl
index 877ebc6..d812f679 100644
--- a/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_30b0b0(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_30b0b0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_30b0b0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_30b0b0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/312f27.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/312f27.wgsl.expected.ir.msl
index f78ff10..ebb6437 100644
--- a/test/tint/builtins/gen/var/textureStore/312f27.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/312f27.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_312f27(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_312f27 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_312f27(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_312f27
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_312f27(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_312f27
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_312f27(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_312f27
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/31745b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.ir.msl
index 877ebc6..9d6fc40 100644
--- a/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_31745b(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_31745b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_31745b(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_31745b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/319029.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/319029.wgsl.expected.ir.msl
index 877ebc6..21cb299 100644
--- a/test/tint/builtins/gen/var/textureStore/319029.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/319029.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_319029(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_319029(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_319029(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_319029(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/32d3d6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/32d3d6.wgsl.expected.ir.msl
index 1df4ada..47be86a 100644
--- a/test/tint/builtins/gen/var/textureStore/32d3d6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/32d3d6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_32d3d6(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_32d3d6 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_32d3d6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_32d3d6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32d3d6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_32d3d6
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32d3d6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_32d3d6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/32f368.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/32f368.wgsl.expected.ir.msl
index 877ebc6..1f8491d 100644
--- a/test/tint/builtins/gen/var/textureStore/32f368.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/32f368.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_32f368(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_32f368(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32f368(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_32f368(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/330b7c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/330b7c.wgsl.expected.ir.msl
index 877ebc6..c7e8548 100644
--- a/test/tint/builtins/gen/var/textureStore/330b7c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/330b7c.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_330b7c(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_330b7c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_330b7c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_330b7c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3310d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3310d3.wgsl.expected.ir.msl
index 6e8e0c3..9904031 100644
--- a/test/tint/builtins/gen/var/textureStore/3310d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3310d3.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3310d3(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3310d3 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3310d3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_3310d3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3310d3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_3310d3
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3310d3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_3310d3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/331aee.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/331aee.wgsl.expected.ir.msl
index 877ebc6..5e244a1 100644
--- a/test/tint/builtins/gen/var/textureStore/331aee.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/331aee.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_331aee(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_331aee(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_331aee(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_331aee(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/33cec0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/33cec0.wgsl.expected.ir.msl
index 877ebc6..9d152e1 100644
--- a/test/tint/builtins/gen/var/textureStore/33cec0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/33cec0.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_33cec0(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_33cec0(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_33cec0(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_33cec0(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/345332.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/345332.wgsl.expected.ir.msl
index 84f5c73..37e15b2 100644
--- a/test/tint/builtins/gen/var/textureStore/345332.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/345332.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_345332(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_345332 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_345332(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_345332
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_345332(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_345332
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_345332(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_345332
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/37eeef.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.ir.msl
index 877ebc6..9f902c6 100644
--- a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_37eeef(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_37eeef(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37eeef(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37eeef(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl.expected.ir.msl
index 877ebc6..38156c1 100644
--- a/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_37ffd4(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_37ffd4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37ffd4(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_37ffd4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl.expected.ir.msl
index 877ebc6..ee2947d 100644
--- a/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_38e8d7(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_38e8d7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_38e8d7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_38e8d7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl.expected.ir.msl
index 877ebc6..dd76d6a 100644
--- a/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3a52ac(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3a52ac(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3a52ac(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3a52ac(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl.expected.ir.msl
index 877ebc6..3212d12 100644
--- a/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3bb7a1(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3bb7a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bb7a1(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bb7a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3bec15.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3bec15.wgsl.expected.ir.msl
index 877ebc6..b67af6e 100644
--- a/test/tint/builtins/gen/var/textureStore/3bec15.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3bec15.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3bec15(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3bec15(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bec15(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3bec15(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3c1937.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3c1937.wgsl.expected.ir.msl
index 877ebc6..6e832e4 100644
--- a/test/tint/builtins/gen/var/textureStore/3c1937.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3c1937.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3c1937(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3c1937(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3c1937(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3c1937(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3d1ebe.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3d1ebe.wgsl.expected.ir.msl
index 3fc29a2..3ac5439 100644
--- a/test/tint/builtins/gen/var/textureStore/3d1ebe.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3d1ebe.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3d1ebe(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3d1ebe = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<r32float, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d1ebe(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_3d1ebe
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d1ebe(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_3d1ebe
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d1ebe(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_3d1ebe
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3d6f01.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.ir.msl
index 877ebc6..de282cc 100644
--- a/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3d6f01(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d6f01(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d6f01(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d6f01(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3d96a4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3d96a4.wgsl.expected.ir.msl
index 979d34ff..7cbf173 100644
--- a/test/tint/builtins/gen/var/textureStore/3d96a4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3d96a4.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3d96a4(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3d96a4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3d96a4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_3d96a4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d96a4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_3d96a4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3d96a4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_3d96a4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3e0dc4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.ir.msl
index 3ed6786..411c464 100644
--- a/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3e0dc4(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3e0dc4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3e0dc4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_3e0dc4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3e0dc4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_3e0dc4
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3e0dc4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_3e0dc4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3f61ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3f61ca.wgsl.expected.ir.msl
index 2907fe9..602cf5e 100644
--- a/test/tint/builtins/gen/var/textureStore/3f61ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3f61ca.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_3f61ca(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_3f61ca = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3f61ca(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_3f61ca
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3f61ca(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_3f61ca
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3f61ca(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_3f61ca
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/3fb31f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.ir.msl
index 877ebc6..05ca798 100644
--- a/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_3fb31f(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_3fb31f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3fb31f(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_3fb31f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/40c455.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/40c455.wgsl.expected.ir.msl
index 877ebc6..1d27cda 100644
--- a/test/tint/builtins/gen/var/textureStore/40c455.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/40c455.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_40c455(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_40c455(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_40c455(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_40c455(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4288fc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4288fc.wgsl.expected.ir.msl
index 877ebc6..e379391 100644
--- a/test/tint/builtins/gen/var/textureStore/4288fc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4288fc.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4288fc(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4288fc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4288fc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4288fc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.ir.msl
index 4b1a6fc..fd2f58f 100644
--- a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_43d1df(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_43d1df = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_43d1df(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_43d1df
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_43d1df(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_43d1df
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_43d1df(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_43d1df
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/441222.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/441222.wgsl.expected.ir.msl
index b1bd42e..8bab146 100644
--- a/test/tint/builtins/gen/var/textureStore/441222.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/441222.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_441222(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_441222 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_441222(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_441222
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441222(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_441222
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441222(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_441222
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/441ba8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/441ba8.wgsl.expected.ir.msl
index 877ebc6..ee0bde7 100644
--- a/test/tint/builtins/gen/var/textureStore/441ba8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/441ba8.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_441ba8(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_441ba8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441ba8(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_441ba8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4483e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4483e7.wgsl.expected.ir.msl
index 5cfba14..0cbb43c 100644
--- a/test/tint/builtins/gen/var/textureStore/4483e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4483e7.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4483e7(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4483e7 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4483e7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_4483e7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4483e7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_4483e7
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4483e7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_4483e7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/44b372.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/44b372.wgsl.expected.ir.msl
index ca5c54b..910c631 100644
--- a/test/tint/builtins/gen/var/textureStore/44b372.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/44b372.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_44b372(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_44b372 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_44b372(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_44b372
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44b372(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_44b372
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44b372(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_44b372
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/44daa7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/44daa7.wgsl.expected.ir.msl
index 877ebc6..3c2262a 100644
--- a/test/tint/builtins/gen/var/textureStore/44daa7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/44daa7.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_44daa7(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_44daa7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44daa7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_44daa7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.ir.msl
index 31a9294..2b5cd68 100644
--- a/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_473ead(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_473ead = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_473ead(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_473ead
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_473ead(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_473ead
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_473ead(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_473ead
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/47bd70.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/47bd70.wgsl.expected.ir.msl
index be541c7..e289cf9 100644
--- a/test/tint/builtins/gen/var/textureStore/47bd70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/47bd70.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_47bd70(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_47bd70 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_47bd70(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_47bd70
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_47bd70(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_47bd70
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_47bd70(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_47bd70
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/486500.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/486500.wgsl.expected.ir.msl
index 877ebc6..fbed739 100644
--- a/test/tint/builtins/gen/var/textureStore/486500.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/486500.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_486500(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_486500(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_486500(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_486500(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/48cb56.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/48cb56.wgsl.expected.ir.msl
index 187eadd..cb8c96a 100644
--- a/test/tint/builtins/gen/var/textureStore/48cb56.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/48cb56.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_48cb56(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_48cb56 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_48cb56(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_48cb56
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48cb56(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_48cb56
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48cb56(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_48cb56
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/48eae1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.ir.msl
index 877ebc6..36f9e22 100644
--- a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_48eae1(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_48eae1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48eae1(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_48eae1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4bf1fd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4bf1fd.wgsl.expected.ir.msl
index 0f638d7..45bf8fc 100644
--- a/test/tint/builtins/gen/var/textureStore/4bf1fd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4bf1fd.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4bf1fd(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4bf1fd = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4bf1fd(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_4bf1fd
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4bf1fd(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_4bf1fd
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4bf1fd(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_4bf1fd
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4c454f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.ir.msl
index 877ebc6..6ce46b9 100644
--- a/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4c454f(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4c454f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c454f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c454f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4c76b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4c76b7.wgsl.expected.ir.msl
index a0c2b48..a46472c 100644
--- a/test/tint/builtins/gen/var/textureStore/4c76b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4c76b7.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4c76b7(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4c76b7 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4c76b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_4c76b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c76b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_4c76b7
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4c76b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_4c76b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4cce74.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.ir.msl
index 1bdcc28..95a2c80 100644
--- a/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4cce74(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4cce74 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4cce74(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_4cce74
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4cce74(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_4cce74
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4cce74(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_4cce74
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4d359d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.ir.msl
index 877ebc6..f6d6659 100644
--- a/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4d359d(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4d359d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4d359d(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4d359d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4ddf52.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4ddf52.wgsl.expected.ir.msl
index 3a6ff7b..7a06398 100644
--- a/test/tint/builtins/gen/var/textureStore/4ddf52.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4ddf52.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4ddf52(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4ddf52 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4ddf52(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_4ddf52
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4ddf52(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_4ddf52
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4ddf52(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_4ddf52
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4e2b3a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.ir.msl
index 4876340..cfb6716 100644
--- a/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_4e2b3a(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_4e2b3a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4e2b3a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_4e2b3a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4e2b3a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_4e2b3a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4e2b3a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_4e2b3a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/4fc057.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/4fc057.wgsl.expected.ir.msl
index 877ebc6..3085b58 100644
--- a/test/tint/builtins/gen/var/textureStore/4fc057.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/4fc057.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_4fc057(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_4fc057(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4fc057(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_4fc057(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/5030f5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5030f5.wgsl.expected.ir.msl
index 658b24d..0d6615e 100644
--- a/test/tint/builtins/gen/var/textureStore/5030f5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5030f5.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5030f5(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5030f5 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5030f5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_5030f5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5030f5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_5030f5
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5030f5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_5030f5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/506a71.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.ir.msl
index 877ebc6..261f8c3 100644
--- a/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_506a71(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_506a71(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_506a71(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_506a71(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.ir.msl
index a352962..3ad8a38 100644
--- a/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_51ec82(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_51ec82 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_51ec82(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_51ec82
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_51ec82(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_51ec82
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_51ec82(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_51ec82
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5246b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5246b4.wgsl.expected.ir.msl
index 5a0c87c..34d7384 100644
--- a/test/tint/builtins/gen/var/textureStore/5246b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5246b4.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5246b4(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5246b4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5246b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_5246b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5246b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_5246b4
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5246b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_5246b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/52f503.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/52f503.wgsl.expected.ir.msl
index 877ebc6..76e10ba 100644
--- a/test/tint/builtins/gen/var/textureStore/52f503.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/52f503.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_52f503(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_52f503(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_52f503(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_52f503(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/53a68b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/53a68b.wgsl.expected.ir.msl
index 9bb503b..5cb8c2b 100644
--- a/test/tint/builtins/gen/var/textureStore/53a68b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/53a68b.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_53a68b(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_53a68b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_53a68b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_53a68b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_53a68b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_53a68b
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_53a68b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_53a68b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5425ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.ir.msl
index 248d50f..1fc0b50 100644
--- a/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5425ab(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5425ab = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5425ab(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_5425ab
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5425ab(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_5425ab
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5425ab(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_5425ab
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/544f06.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/544f06.wgsl.expected.ir.msl
index 6b786d3..272cdb8 100644
--- a/test/tint/builtins/gen/var/textureStore/544f06.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/544f06.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_544f06(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_544f06 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_544f06(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_544f06
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_544f06(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_544f06
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_544f06(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_544f06
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/55f9dc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/55f9dc.wgsl.expected.ir.msl
index 3aef58f..91f73af 100644
--- a/test/tint/builtins/gen/var/textureStore/55f9dc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/55f9dc.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_55f9dc(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_55f9dc = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_55f9dc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_55f9dc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_55f9dc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_55f9dc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_55f9dc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_55f9dc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/574a31.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.ir.msl
index 59d8f7e..34bab81 100644
--- a/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_574a31(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_574a31 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_574a31(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_574a31
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_574a31(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_574a31
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_574a31(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_574a31
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/579b93.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/579b93.wgsl.expected.ir.msl
index c56c9fd..049d438 100644
--- a/test/tint/builtins/gen/var/textureStore/579b93.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/579b93.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_579b93(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_579b93 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_579b93(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_579b93
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_579b93(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_579b93
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_579b93(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_579b93
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5841f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5841f8.wgsl.expected.ir.msl
index 877ebc6..66485df 100644
--- a/test/tint/builtins/gen/var/textureStore/5841f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5841f8.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5841f8(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5841f8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5841f8(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5841f8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/58fc35.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/58fc35.wgsl.expected.ir.msl
index ee3dda9..a06e971 100644
--- a/test/tint/builtins/gen/var/textureStore/58fc35.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/58fc35.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_58fc35(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_58fc35 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_58fc35(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_58fc35
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_58fc35(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_58fc35
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_58fc35(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_58fc35
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/59a0ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl.expected.ir.msl
index 877ebc6..886855e 100644
--- a/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_59a0ab(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_59a0ab(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_59a0ab(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_59a0ab(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl.expected.ir.msl
index 877ebc6..daefca4 100644
--- a/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5a2f8f(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5a2f8f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a2f8f(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a2f8f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/5a8b41.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5a8b41.wgsl.expected.ir.msl
index 28a696e..2c7e851 100644
--- a/test/tint/builtins/gen/var/textureStore/5a8b41.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5a8b41.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5a8b41(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5a8b41 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5a8b41(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_5a8b41
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a8b41(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_5a8b41
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5a8b41(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_5a8b41
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5b17eb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.ir.msl
index 760b399..3864abc 100644
--- a/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5b17eb(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5b17eb = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5b17eb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_5b17eb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b17eb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_5b17eb
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b17eb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_5b17eb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5b4522.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5b4522.wgsl.expected.ir.msl
index 1eceebb..5fbaa36 100644
--- a/test/tint/builtins/gen/var/textureStore/5b4522.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5b4522.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5b4522(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5b4522 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5b4522(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_5b4522
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b4522(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_5b4522
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5b4522(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_5b4522
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5bc4f3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.ir.msl
index 877ebc6..eaa024e 100644
--- a/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5bc4f3(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5bc4f3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5bc4f3(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5bc4f3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl.expected.ir.msl
index 877ebc6..cd78e63 100644
--- a/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5ddc61(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ddc61(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ddc61(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ddc61(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/5ec6b2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5ec6b2.wgsl.expected.ir.msl
index 8d754b2..10b5443 100644
--- a/test/tint/builtins/gen/var/textureStore/5ec6b2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5ec6b2.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5ec6b2(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5ec6b2 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<r32float, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ec6b2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_5ec6b2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ec6b2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_5ec6b2
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ec6b2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_5ec6b2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5ee194.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.ir.msl
index 632e903..033e335 100644
--- a/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_5ee194(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_5ee194 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5ee194(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_5ee194
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ee194(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_5ee194
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5ee194(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_5ee194
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/5f9a49.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl.expected.ir.msl
index 877ebc6..a864569 100644
--- a/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_5f9a49(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_5f9a49(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5f9a49(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_5f9a49(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.ir.msl
index 877ebc6..cbfa4b2 100644
--- a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_602b5a(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_602b5a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_602b5a(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_602b5a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/60975f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/60975f.wgsl.expected.ir.msl
index 877ebc6..e50bd8f 100644
--- a/test/tint/builtins/gen/var/textureStore/60975f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/60975f.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_60975f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_60975f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_60975f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_60975f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/614b58.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/614b58.wgsl.expected.ir.msl
index de843b2..48d7a7f 100644
--- a/test/tint/builtins/gen/var/textureStore/614b58.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/614b58.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_614b58(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_614b58 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_614b58(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_614b58
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_614b58(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_614b58
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_614b58(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_614b58
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/635584.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.ir.msl
index d42b23d..6da05cf 100644
--- a/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_635584(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_635584 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_635584(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_635584
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_635584(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_635584
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_635584(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_635584
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/63f34a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.ir.msl
index bd4b7a2..6b8f5c0 100644
--- a/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_63f34a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_63f34a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_63f34a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_63f34a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_63f34a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_63f34a
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_63f34a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_63f34a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/646dbc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/646dbc.wgsl.expected.ir.msl
index 311dd0a..5d55df1 100644
--- a/test/tint/builtins/gen/var/textureStore/646dbc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/646dbc.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_646dbc(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_646dbc = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_646dbc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_646dbc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_646dbc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_646dbc
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_646dbc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_646dbc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/658a74.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.ir.msl
index 877ebc6..e955610 100644
--- a/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_658a74(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_658a74(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_658a74(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_658a74(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/65b6aa.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/65b6aa.wgsl.expected.ir.msl
index 29ad191..a3f6ff1 100644
--- a/test/tint/builtins/gen/var/textureStore/65b6aa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/65b6aa.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_65b6aa(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_65b6aa = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_65b6aa(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_65b6aa
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65b6aa(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_65b6aa
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65b6aa(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_65b6aa
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/65ba8b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.ir.msl
index 6ddedc4..382d647 100644
--- a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_65ba8b(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_65ba8b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_65ba8b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_65ba8b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65ba8b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_65ba8b
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_65ba8b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_65ba8b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/682fd6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.ir.msl
index 877ebc6..f13f27a 100644
--- a/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_682fd6(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_682fd6(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_682fd6(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_682fd6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/699a1b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/699a1b.wgsl.expected.ir.msl
index 877ebc6..831f4c4 100644
--- a/test/tint/builtins/gen/var/textureStore/699a1b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/699a1b.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_699a1b(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_699a1b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_699a1b(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_699a1b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl.expected.ir.msl
index 877ebc6..d31f4aa 100644
--- a/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6b75c3(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6b75c3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b75c3(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b75c3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl.expected.ir.msl
index 877ebc6..95153a3 100644
--- a/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6b80d2(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6b80d2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b80d2(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6b80d2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6be9e0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6be9e0.wgsl.expected.ir.msl
index 8d9c752..6b2975a 100644
--- a/test/tint/builtins/gen/var/textureStore/6be9e0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6be9e0.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6be9e0(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6be9e0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<r32float, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6be9e0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6be9e0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6be9e0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6be9e0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6be9e0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6be9e0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6c4a70.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6c4a70.wgsl.expected.ir.msl
index b2cea3d..905745e 100644
--- a/test/tint/builtins/gen/var/textureStore/6c4a70.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6c4a70.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6c4a70(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6c4a70 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6c4a70(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6c4a70
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6c4a70(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6c4a70
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6c4a70(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6c4a70
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6cff2e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl.expected.ir.msl
index 877ebc6..208274a 100644
--- a/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6cff2e(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6cff2e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6cff2e(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6cff2e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6d1809.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6d1809.wgsl.expected.ir.msl
index 9f48a35..8b144b8 100644
--- a/test/tint/builtins/gen/var/textureStore/6d1809.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6d1809.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6d1809(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6d1809 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6d1809(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_6d1809
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d1809(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_6d1809
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d1809(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_6d1809
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6d259f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6d259f.wgsl.expected.ir.msl
index 5dc1c35..a7442db 100644
--- a/test/tint/builtins/gen/var/textureStore/6d259f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6d259f.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6d259f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6d259f = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6d259f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6d259f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d259f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6d259f
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6d259f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6d259f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6da692.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6da692.wgsl.expected.ir.msl
index 877ebc6..10576ca 100644
--- a/test/tint/builtins/gen/var/textureStore/6da692.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6da692.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6da692(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6da692(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6da692(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6da692(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6e6cc0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6e6cc0.wgsl.expected.ir.msl
index 493fb80..ab1e14a 100644
--- a/test/tint/builtins/gen/var/textureStore/6e6cc0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6e6cc0.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6e6cc0(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6e6cc0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<r32float, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6e6cc0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6e6cc0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6e6cc0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6e6cc0
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6e6cc0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6e6cc0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f0c92.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.ir.msl
index 9fdb806..b458f21 100644
--- a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6f0c92(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6f0c92 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f0c92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_6f0c92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f0c92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_6f0c92
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f0c92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_6f0c92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f3542.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6f3542.wgsl.expected.ir.msl
index 316f7e5..a1c82dd 100644
--- a/test/tint/builtins/gen/var/textureStore/6f3542.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6f3542.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6f3542(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6f3542 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f3542(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6f3542
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f3542(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6f3542
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f3542(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6f3542
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6f8642.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6f8642.wgsl.expected.ir.msl
index 877ebc6..e7c866f 100644
--- a/test/tint/builtins/gen/var/textureStore/6f8642.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6f8642.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6f8642(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6f8642(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f8642(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6f8642(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6fb99b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6fb99b.wgsl.expected.ir.msl
index 5b21ca4..49f1f8d 100644
--- a/test/tint/builtins/gen/var/textureStore/6fb99b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6fb99b.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_6fb99b(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_6fb99b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6fb99b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_6fb99b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fb99b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_6fb99b
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fb99b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_6fb99b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/6fd2b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.ir.msl
index 877ebc6..b64e7e6 100644
--- a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_6fd2b1(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_6fd2b1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fd2b1(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_6fd2b1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/704e1f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/704e1f.wgsl.expected.ir.msl
index b3d5e18..92f2267e 100644
--- a/test/tint/builtins/gen/var/textureStore/704e1f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/704e1f.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_704e1f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_704e1f = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_704e1f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_704e1f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_704e1f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_704e1f
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_704e1f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_704e1f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/706236.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/706236.wgsl.expected.ir.msl
index 2d33612..9f7b80b 100644
--- a/test/tint/builtins/gen/var/textureStore/706236.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/706236.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_706236(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_706236 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_706236(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_706236
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706236(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_706236
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706236(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_706236
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/706560.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/706560.wgsl.expected.ir.msl
index 41aab47..c27402c 100644
--- a/test/tint/builtins/gen/var/textureStore/706560.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/706560.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_706560(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_706560 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_706560(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_706560
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706560(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_706560
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_706560(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_706560
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/726472.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.ir.msl
index 877ebc6..4cd8eb1 100644
--- a/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_726472(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_726472(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726472(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726472(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/726d6d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/726d6d.wgsl.expected.ir.msl
index f869430..a2b2ca1 100644
--- a/test/tint/builtins/gen/var/textureStore/726d6d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/726d6d.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_726d6d(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_726d6d = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_726d6d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_726d6d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726d6d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_726d6d
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_726d6d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_726d6d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/72fa64.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.ir.msl
index 877ebc6..028c26f 100644
--- a/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_72fa64(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_72fa64(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_72fa64(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_72fa64(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/731349.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/731349.wgsl.expected.ir.msl
index 877ebc6..8cda3b0 100644
--- a/test/tint/builtins/gen/var/textureStore/731349.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/731349.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_731349(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_731349(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_731349(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_731349(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/73a735.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/73a735.wgsl.expected.ir.msl
index cdc8572..e40f6e3 100644
--- a/test/tint/builtins/gen/var/textureStore/73a735.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/73a735.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_73a735(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_73a735 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_73a735(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_73a735
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73a735(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_73a735
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73a735(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_73a735
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/73bbbc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl.expected.ir.msl
index 877ebc6..0cbb2f3 100644
--- a/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_73bbbc(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_73bbbc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73bbbc(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_73bbbc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.ir.msl
index 877ebc6..970d612 100644
--- a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_74886f(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_74886f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_74886f(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_74886f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/751256.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/751256.wgsl.expected.ir.msl
index 56b34f5..9568e20 100644
--- a/test/tint/builtins/gen/var/textureStore/751256.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/751256.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_751256(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_751256 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_751256(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_751256
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_751256(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_751256
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_751256(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_751256
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/752da6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/752da6.wgsl.expected.ir.msl
index 877ebc6..277fe8a 100644
--- a/test/tint/builtins/gen/var/textureStore/752da6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/752da6.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_752da6(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_752da6(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_752da6(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_752da6(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.ir.msl
index 9c6ff1a..4a2627e 100644
--- a/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_75bbd5(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_75bbd5 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_75bbd5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_75bbd5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_75bbd5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_75bbd5
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_75bbd5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_75bbd5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/76affd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/76affd.wgsl.expected.ir.msl
index 877ebc6..1ec7a3d 100644
--- a/test/tint/builtins/gen/var/textureStore/76affd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/76affd.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_76affd(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_76affd(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_76affd(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_76affd(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.ir.msl
index 235dda1..268e747 100644
--- a/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7792fa(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7792fa = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7792fa(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_7792fa
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7792fa(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_7792fa
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7792fa(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_7792fa
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/779d14.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/779d14.wgsl.expected.ir.msl
index 877ebc6..00d51b7 100644
--- a/test/tint/builtins/gen/var/textureStore/779d14.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/779d14.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_779d14(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_779d14(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_779d14(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_779d14(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl.expected.ir.msl
index 877ebc6..a2ee047 100644
--- a/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_77c0ae(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_77c0ae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_77c0ae(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_77c0ae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.ir.msl
index 5ffbb81..025e9d3 100644
--- a/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7b8f86(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7b8f86 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7b8f86(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_7b8f86
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7b8f86(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_7b8f86
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7b8f86(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_7b8f86
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7bb211.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.ir.msl
index 877ebc6..bc1dcf6 100644
--- a/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7bb211(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7bb211(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7bb211(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7bb211(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl.expected.ir.msl
index 877ebc6..dcbec43 100644
--- a/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7cec8d(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7cec8d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cec8d(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cec8d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl.expected.ir.msl
index 877ebc6..c07f52d 100644
--- a/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7cf6e7(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7cf6e7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cf6e7(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7cf6e7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/7d10e0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7d10e0.wgsl.expected.ir.msl
index 1f417e6..63f95ba 100644
--- a/test/tint/builtins/gen/var/textureStore/7d10e0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7d10e0.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7d10e0(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7d10e0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7d10e0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_7d10e0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7d10e0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_7d10e0
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7d10e0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_7d10e0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7dd042.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7dd042.wgsl.expected.ir.msl
index 65df419..cc61492 100644
--- a/test/tint/builtins/gen/var/textureStore/7dd042.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7dd042.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7dd042(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7dd042 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7dd042(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_7dd042
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7dd042(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_7dd042
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7dd042(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_7dd042
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7e787a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7e787a.wgsl.expected.ir.msl
index 697cffc..97c730c 100644
--- a/test/tint/builtins/gen/var/textureStore/7e787a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7e787a.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_7e787a(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_7e787a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7e787a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_7e787a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7e787a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_7e787a
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7e787a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_7e787a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/7f7fae.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl.expected.ir.msl
index 877ebc6..7d74f7a 100644
--- a/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_7f7fae(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_7f7fae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7f7fae(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_7f7fae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.ir.msl
index 81af8cd..01e1dc9 100644
--- a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_803a10(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_803a10 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_803a10(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_803a10
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_803a10(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_803a10
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_803a10(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_803a10
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/804942.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/804942.wgsl.expected.ir.msl
index 877ebc6..51cdf88 100644
--- a/test/tint/builtins/gen/var/textureStore/804942.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/804942.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_804942(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_804942(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_804942(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_804942(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/805dae.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/805dae.wgsl.expected.ir.msl
index 877ebc6..aa86599 100644
--- a/test/tint/builtins/gen/var/textureStore/805dae.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/805dae.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_805dae(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_805dae(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_805dae(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_805dae(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.ir.msl
index 6a21585..55cd24e 100644
--- a/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_80bf1d(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_80bf1d = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_80bf1d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_80bf1d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_80bf1d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_80bf1d
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_80bf1d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_80bf1d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/818df6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/818df6.wgsl.expected.ir.msl
index c9e4cf1..903565d 100644
--- a/test/tint/builtins/gen/var/textureStore/818df6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/818df6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_818df6(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_818df6 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_818df6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_818df6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_818df6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_818df6
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_818df6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_818df6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/81ae31.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/81ae31.wgsl.expected.ir.msl
index 593c30e0..a787d7b 100644
--- a/test/tint/builtins/gen/var/textureStore/81ae31.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/81ae31.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_81ae31(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_81ae31 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_81ae31(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_81ae31
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_81ae31(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_81ae31
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_81ae31(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_81ae31
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/820272.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.ir.msl
index b8a9be7..6bf3573 100644
--- a/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_820272(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_820272 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_820272(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_820272
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_820272(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_820272
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_820272(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_820272
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/83bcc1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.ir.msl
index 877ebc6..be528ee 100644
--- a/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_83bcc1(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_83bcc1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_83bcc1(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_83bcc1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.ir.msl
index 06aa231..876124b 100644
--- a/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_84d435(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_84d435 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_84d435(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_84d435
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84d435(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_84d435
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84d435(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_84d435
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/84f4f4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/84f4f4.wgsl.expected.ir.msl
index e72f8ea..d859cc3 100644
--- a/test/tint/builtins/gen/var/textureStore/84f4f4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/84f4f4.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_84f4f4(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_84f4f4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_84f4f4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_84f4f4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84f4f4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_84f4f4
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_84f4f4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_84f4f4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8676c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8676c9.wgsl.expected.ir.msl
index d08badd..63a5bfa 100644
--- a/test/tint/builtins/gen/var/textureStore/8676c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8676c9.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8676c9(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8676c9 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8676c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_8676c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8676c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_8676c9
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8676c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_8676c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/86f713.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/86f713.wgsl.expected.ir.msl
index 97c7879..7291d8e 100644
--- a/test/tint/builtins/gen/var/textureStore/86f713.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/86f713.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_86f713(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_86f713 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_86f713(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_86f713
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_86f713(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_86f713
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_86f713(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_86f713
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/872747.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.ir.msl
index 877ebc6..ab3b54e 100644
--- a/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_872747(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_872747(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_872747(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_872747(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/877c92.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/877c92.wgsl.expected.ir.msl
index 6eb3de5..7af1554 100644
--- a/test/tint/builtins/gen/var/textureStore/877c92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/877c92.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_877c92(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_877c92 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_877c92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_877c92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_877c92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_877c92
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_877c92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_877c92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8815b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8815b1.wgsl.expected.ir.msl
index dc5eea5..795c4c0 100644
--- a/test/tint/builtins/gen/var/textureStore/8815b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8815b1.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8815b1(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8815b1 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8815b1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8815b1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8815b1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8815b1
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8815b1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8815b1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/885921.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/885921.wgsl.expected.ir.msl
index 6a57211..2751d93 100644
--- a/test/tint/builtins/gen/var/textureStore/885921.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/885921.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_885921(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_885921 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_885921(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_885921
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_885921(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_885921
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_885921(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_885921
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/88ce7e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/88ce7e.wgsl.expected.ir.msl
index 57ad9c7..206d298 100644
--- a/test/tint/builtins/gen/var/textureStore/88ce7e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/88ce7e.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_88ce7e(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_88ce7e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_88ce7e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_88ce7e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_88ce7e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_88ce7e
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_88ce7e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_88ce7e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a16b0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8a16b0.wgsl.expected.ir.msl
index a6e5e09..eaaa77a 100644
--- a/test/tint/builtins/gen/var/textureStore/8a16b0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8a16b0.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a16b0(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a16b0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a16b0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8a16b0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a16b0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8a16b0
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a16b0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8a16b0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a46ff.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8a46ff.wgsl.expected.ir.msl
index 01d8c5d..6e7eb42 100644
--- a/test/tint/builtins/gen/var/textureStore/8a46ff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8a46ff.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a46ff(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a46ff = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a46ff(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_8a46ff
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a46ff(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_8a46ff
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a46ff(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_8a46ff
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a85b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8a85b9.wgsl.expected.ir.msl
index fa89898..a37b248 100644
--- a/test/tint/builtins/gen/var/textureStore/8a85b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8a85b9.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a85b9(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a85b9 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a85b9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8a85b9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a85b9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8a85b9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a85b9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8a85b9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8a8681.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.ir.msl
index 73faffe..1ba5c1f 100644
--- a/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8a8681(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8a8681 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8a8681(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_8a8681
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a8681(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_8a8681
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8a8681(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_8a8681
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8ae0bc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8ae0bc.wgsl.expected.ir.msl
index bc62be0..92c3cad 100644
--- a/test/tint/builtins/gen/var/textureStore/8ae0bc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8ae0bc.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8ae0bc(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8ae0bc = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ae0bc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8ae0bc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ae0bc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8ae0bc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ae0bc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8ae0bc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8b9310.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8b9310.wgsl.expected.ir.msl
index 877ebc6..e032e71 100644
--- a/test/tint/builtins/gen/var/textureStore/8b9310.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8b9310.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8b9310(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8b9310(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8b9310(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8b9310(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8bb287.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8bb287.wgsl.expected.ir.msl
index 877ebc6..6592fe4 100644
--- a/test/tint/builtins/gen/var/textureStore/8bb287.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8bb287.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8bb287(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8bb287(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8bb287(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8bb287(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl.expected.ir.msl
index 877ebc6..88384ed 100644
--- a/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8c76e9(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8c76e9(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8c76e9(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8c76e9(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.ir.msl
index 877ebc6..cd51130 100644
--- a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8cd611(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8cd611(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd611(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd611(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8cd841.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8cd841.wgsl.expected.ir.msl
index c3bb67f..ba3c8f8 100644
--- a/test/tint/builtins/gen/var/textureStore/8cd841.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8cd841.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8cd841(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8cd841 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8cd841(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8cd841
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd841(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8cd841
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8cd841(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8cd841
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8dc54f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl.expected.ir.msl
index 877ebc6..eb3ccd4 100644
--- a/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8dc54f(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8dc54f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8dc54f(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8dc54f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8e0479.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8e0479.wgsl.expected.ir.msl
index 877ebc6..f0e6c86 100644
--- a/test/tint/builtins/gen/var/textureStore/8e0479.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8e0479.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8e0479(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8e0479(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8e0479(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8e0479(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8ebdc9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8ebdc9.wgsl.expected.ir.msl
index e8185bd..f1668e4 100644
--- a/test/tint/builtins/gen/var/textureStore/8ebdc9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8ebdc9.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_8ebdc9(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_8ebdc9 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ebdc9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_8ebdc9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ebdc9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_8ebdc9
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ebdc9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_8ebdc9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/8ed9f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl.expected.ir.msl
index 877ebc6..0ee5e9d 100644
--- a/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8ed9f8(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ed9f8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ed9f8(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ed9f8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl.expected.ir.msl
index 877ebc6..30f5268 100644
--- a/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8f71a1(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8f71a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8f71a1(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8f71a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8ff674.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/8ff674.wgsl.expected.ir.msl
index 877ebc6..ec816cf 100644
--- a/test/tint/builtins/gen/var/textureStore/8ff674.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/8ff674.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_8ff674(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_8ff674(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ff674(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_8ff674(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/90960e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/90960e.wgsl.expected.ir.msl
index 05a064d..f986b7c 100644
--- a/test/tint/builtins/gen/var/textureStore/90960e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/90960e.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_90960e(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_90960e = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_90960e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_90960e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90960e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_90960e
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90960e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_90960e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/90a553.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/90a553.wgsl.expected.ir.msl
index 09e53ea..90769cf 100644
--- a/test/tint/builtins/gen/var/textureStore/90a553.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/90a553.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_90a553(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_90a553 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_90a553(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_90a553
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90a553(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_90a553
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_90a553(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_90a553
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/958353.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/958353.wgsl.expected.ir.msl
index 877ebc6..116127f 100644
--- a/test/tint/builtins/gen/var/textureStore/958353.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/958353.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_958353(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_958353(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_958353(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_958353(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/959d94.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/959d94.wgsl.expected.ir.msl
index 877ebc6..2b627b0 100644
--- a/test/tint/builtins/gen/var/textureStore/959d94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/959d94.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_959d94(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_959d94(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_959d94(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_959d94(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/95e452.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/95e452.wgsl.expected.ir.msl
index 877ebc6..8577e11 100644
--- a/test/tint/builtins/gen/var/textureStore/95e452.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/95e452.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_95e452(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_95e452(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_95e452(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_95e452(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/969534.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/969534.wgsl.expected.ir.msl
index 877ebc6..3dabbf1 100644
--- a/test/tint/builtins/gen/var/textureStore/969534.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/969534.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_969534(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_969534(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_969534(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_969534(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/976636.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/976636.wgsl.expected.ir.msl
index 68a6ef1..1dfada3 100644
--- a/test/tint/builtins/gen/var/textureStore/976636.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/976636.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_976636(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_976636 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_976636(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_976636
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_976636(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_976636
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_976636(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_976636
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9938b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9938b7.wgsl.expected.ir.msl
index 877ebc6..481a45c 100644
--- a/test/tint/builtins/gen/var/textureStore/9938b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9938b7.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9938b7(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9938b7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9938b7(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9938b7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl.expected.ir.msl
index 877ebc6..f2e5233 100644
--- a/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9a3ecc(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9a3ecc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9a3ecc(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9a3ecc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl.expected.ir.msl
index 877ebc6..bfa47f0 100644
--- a/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9aedd3(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9aedd3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9aedd3(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9aedd3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9ba5c1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9ba5c1.wgsl.expected.ir.msl
index 8474c2a..590d8a1 100644
--- a/test/tint/builtins/gen/var/textureStore/9ba5c1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9ba5c1.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9ba5c1(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9ba5c1 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9ba5c1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_9ba5c1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9ba5c1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_9ba5c1
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9ba5c1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_9ba5c1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9cea9e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9cea9e.wgsl.expected.ir.msl
index e2fd58c..1357afb 100644
--- a/test/tint/builtins/gen/var/textureStore/9cea9e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9cea9e.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9cea9e(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9cea9e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9cea9e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_9cea9e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9cea9e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_9cea9e
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9cea9e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_9cea9e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9d7c62.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9d7c62.wgsl.expected.ir.msl
index a3e9738..5356378 100644
--- a/test/tint/builtins/gen/var/textureStore/9d7c62.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9d7c62.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_9d7c62(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_9d7c62 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d7c62(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_9d7c62
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d7c62(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_9d7c62
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d7c62(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_9d7c62
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/9d8668.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9d8668.wgsl.expected.ir.msl
index 877ebc6..add863e 100644
--- a/test/tint/builtins/gen/var/textureStore/9d8668.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9d8668.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9d8668(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d8668(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d8668(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d8668(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl.expected.ir.msl
index 877ebc6..19ec296 100644
--- a/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9d9cd5(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9d9cd5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d9cd5(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9d9cd5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl.expected.ir.msl
index 877ebc6..86cd01d 100644
--- a/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9e3ec5(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9e3ec5(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e3ec5(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e3ec5(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.ir.msl
index 877ebc6..2e35c82 100644
--- a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9e5bc2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9e5bc2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e5bc2(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9e5bc2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.ir.msl
index 877ebc6..6064336 100644
--- a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9f5318(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9f5318(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f5318(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f5318(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl.expected.ir.msl
index 877ebc6..a41b247 100644
--- a/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_9f7cea(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_9f7cea(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f7cea(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_9f7cea(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a0022f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a0022f.wgsl.expected.ir.msl
index c38b0f3..fe55372 100644
--- a/test/tint/builtins/gen/var/textureStore/a0022f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a0022f.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a0022f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a0022f = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a0022f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_a0022f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0022f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_a0022f
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0022f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_a0022f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a0f96e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl.expected.ir.msl
index 877ebc6..69cc4ce 100644
--- a/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a0f96e(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a0f96e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0f96e(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a0f96e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a1352c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a1352c.wgsl.expected.ir.msl
index 877ebc6..b60a8c2 100644
--- a/test/tint/builtins/gen/var/textureStore/a1352c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a1352c.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a1352c(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a1352c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a1352c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a1352c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a14041.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a14041.wgsl.expected.ir.msl
index 0d50008..9d4c6ce 100644
--- a/test/tint/builtins/gen/var/textureStore/a14041.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a14041.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a14041(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a14041 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a14041(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a14041
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a14041(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a14041
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a14041(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a14041
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a165b8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a165b8.wgsl.expected.ir.msl
index 877ebc6..cd02e8a 100644
--- a/test/tint/builtins/gen/var/textureStore/a165b8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a165b8.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a165b8(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a165b8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a165b8(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a165b8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a19a12.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a19a12.wgsl.expected.ir.msl
index 22c4ace..76b8746 100644
--- a/test/tint/builtins/gen/var/textureStore/a19a12.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a19a12.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a19a12(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a19a12 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a19a12(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a19a12
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a19a12(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a19a12
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a19a12(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a19a12
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a24491.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a24491.wgsl.expected.ir.msl
index 3fceba8..8934b79 100644
--- a/test/tint/builtins/gen/var/textureStore/a24491.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a24491.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a24491(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a24491 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a24491(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a24491
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a24491(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a24491
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a24491(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a24491
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a4c338.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a4c338.wgsl.expected.ir.msl
index 877ebc6..0eab1b8 100644
--- a/test/tint/builtins/gen/var/textureStore/a4c338.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a4c338.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a4c338(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a4c338(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a4c338(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a4c338(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a5b88e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a5b88e.wgsl.expected.ir.msl
index 358786b..5be22ee 100644
--- a/test/tint/builtins/gen/var/textureStore/a5b88e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a5b88e.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a5b88e(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a5b88e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5b88e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a5b88e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5b88e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a5b88e
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5b88e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a5b88e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a5c925.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a5c925.wgsl.expected.ir.msl
index 5826dcd..5eafd9a 100644
--- a/test/tint/builtins/gen/var/textureStore/a5c925.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a5c925.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a5c925(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a5c925 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5c925(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a5c925
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5c925(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a5c925
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5c925(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a5c925
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a5e80d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl.expected.ir.msl
index 877ebc6..6b9f23a 100644
--- a/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a5e80d(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a5e80d(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5e80d(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a5e80d(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a66ca4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a66ca4.wgsl.expected.ir.msl
index ed7a079..270a7a3 100644
--- a/test/tint/builtins/gen/var/textureStore/a66ca4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a66ca4.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a66ca4(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a66ca4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a66ca4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a66ca4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a66ca4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a66ca4
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a66ca4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a66ca4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a6a986.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a6a986.wgsl.expected.ir.msl
index 877ebc6..9217a43 100644
--- a/test/tint/builtins/gen/var/textureStore/a6a986.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a6a986.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a6a986(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a6a986(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6a986(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6a986(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl.expected.ir.msl
index 877ebc6..2b23ed4 100644
--- a/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a6e78f(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a6e78f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6e78f(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a6e78f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.ir.msl
index 22dddfcd..275200e 100644
--- a/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a702b6(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a702b6 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a702b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_a702b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a702b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_a702b6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a702b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_a702b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a7fc47.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.ir.msl
index ec8286d..4d66064 100644
--- a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a7fc47(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a7fc47 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a7fc47(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a7fc47
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a7fc47(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a7fc47
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a7fc47(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a7fc47
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a9298c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.ir.msl
index c17d72f..231f426 100644
--- a/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_a9298c(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_a9298c = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a9298c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_a9298c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9298c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_a9298c
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9298c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_a9298c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/a9426c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/a9426c.wgsl.expected.ir.msl
index 877ebc6..1dc29fd 100644
--- a/test/tint/builtins/gen/var/textureStore/a9426c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/a9426c.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_a9426c(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_a9426c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9426c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_a9426c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ab03b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ab03b6.wgsl.expected.ir.msl
index 53e75cc..22d9b3d 100644
--- a/test/tint/builtins/gen/var/textureStore/ab03b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ab03b6.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ab03b6(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ab03b6 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ab03b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_ab03b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab03b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_ab03b6
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab03b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_ab03b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ab788e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.ir.msl
index 8fc165a..6ae08e9 100644
--- a/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ab788e(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ab788e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ab788e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_ab788e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab788e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_ab788e
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ab788e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_ab788e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/abdd21.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/abdd21.wgsl.expected.ir.msl
index 290374d..74c438f 100644
--- a/test/tint/builtins/gen/var/textureStore/abdd21.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/abdd21.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_abdd21(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_abdd21 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_abdd21(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_abdd21
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_abdd21(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_abdd21
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_abdd21(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_abdd21
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ac0a55.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ac0a55.wgsl.expected.ir.msl
index 3efd58c..655b700 100644
--- a/test/tint/builtins/gen/var/textureStore/ac0a55.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ac0a55.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ac0a55(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ac0a55 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ac0a55(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_ac0a55
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac0a55(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_ac0a55
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac0a55(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_ac0a55
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ac67aa.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.ir.msl
index 877ebc6..166fa2c 100644
--- a/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ac67aa(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ac67aa(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac67aa(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ac67aa(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.ir.msl
index 1173988..6b86c07 100644
--- a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ae6a2a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ae6a2a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ae6a2a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_ae6a2a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ae6a2a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_ae6a2a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ae6a2a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_ae6a2a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/aeb38a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl.expected.ir.msl
index 877ebc6..140e1b6 100644
--- a/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_aeb38a(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_aeb38a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aeb38a(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aeb38a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/aedea3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/aedea3.wgsl.expected.ir.msl
index 15c86a2..b565b07 100644
--- a/test/tint/builtins/gen/var/textureStore/aedea3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/aedea3.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_aedea3(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_aedea3 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_aedea3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_aedea3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aedea3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_aedea3
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_aedea3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_aedea3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b16110.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b16110.wgsl.expected.ir.msl
index d929329..31d0a7f 100644
--- a/test/tint/builtins/gen/var/textureStore/b16110.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b16110.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b16110(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b16110 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b16110(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_b16110
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b16110(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_b16110
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b16110(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_b16110
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b286b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b286b4.wgsl.expected.ir.msl
index 258e7bd..57e2309 100644
--- a/test/tint/builtins/gen/var/textureStore/b286b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b286b4.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b286b4(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b286b4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b286b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_b286b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b286b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_b286b4
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b286b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_b286b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b36bc1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b36bc1.wgsl.expected.ir.msl
index 779c300..63c089b 100644
--- a/test/tint/builtins/gen/var/textureStore/b36bc1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b36bc1.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b36bc1(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b36bc1 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b36bc1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_b36bc1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b36bc1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_b36bc1
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b36bc1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_b36bc1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b42fd3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl.expected.ir.msl
index 877ebc6..b7625c5 100644
--- a/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b42fd3(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b42fd3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b42fd3(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b42fd3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b4389e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b4389e.wgsl.expected.ir.msl
index c5974ca..722b1b4 100644
--- a/test/tint/builtins/gen/var/textureStore/b4389e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b4389e.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b4389e(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b4389e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b4389e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_b4389e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b4389e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_b4389e
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b4389e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_b4389e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b706b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b706b1.wgsl.expected.ir.msl
index 877ebc6..d27f542 100644
--- a/test/tint/builtins/gen/var/textureStore/b706b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b706b1.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b706b1(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b706b1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b706b1(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b706b1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b70ded.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b70ded.wgsl.expected.ir.msl
index 877ebc6..f204794 100644
--- a/test/tint/builtins/gen/var/textureStore/b70ded.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b70ded.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b70ded(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b70ded(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b70ded(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b70ded(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.ir.msl
index c382699..e8e3080 100644
--- a/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b71c13(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b71c13 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b71c13(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_b71c13
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b71c13(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_b71c13
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b71c13(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_b71c13
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b7232c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b7232c.wgsl.expected.ir.msl
index 3ed1419..22557ab 100644
--- a/test/tint/builtins/gen/var/textureStore/b7232c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b7232c.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b7232c(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b7232c = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_1d<r32float, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b7232c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_b7232c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b7232c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_b7232c
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b7232c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_b7232c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b76ff3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl.expected.ir.msl
index 877ebc6..1d1c7d5 100644
--- a/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b76ff3(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b76ff3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b76ff3(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b76ff3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.ir.msl
index 877ebc6..3163c3b 100644
--- a/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b77161(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b77161(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b77161(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b77161(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b89ffb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b89ffb.wgsl.expected.ir.msl
index 2132dfa..e6df315 100644
--- a/test/tint/builtins/gen/var/textureStore/b89ffb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b89ffb.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b89ffb(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b89ffb = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b89ffb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_b89ffb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b89ffb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_b89ffb
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b89ffb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_b89ffb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b91b86.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.ir.msl
index 877ebc6..322d669 100644
--- a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_b91b86(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b91b86(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b91b86(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b91b86(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.ir.msl
index d5d067c..998dd58 100644
--- a/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b9c81a(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b9c81a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b9c81a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_b9c81a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9c81a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_b9c81a
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9c81a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_b9c81a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/b9d863.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/b9d863.wgsl.expected.ir.msl
index fe8edf3..b66e583 100644
--- a/test/tint/builtins/gen/var/textureStore/b9d863.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/b9d863.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_b9d863(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_b9d863 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_b9d863(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_b9d863
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9d863(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_b9d863
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_b9d863(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_b9d863
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bbcb7f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl.expected.ir.msl
index 877ebc6..3f2c4cf 100644
--- a/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bbcb7f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bbcb7f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bbcb7f(tint_module_vars);
+}
+kernel void compute_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bbcb7f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/bc1423.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bc1423.wgsl.expected.ir.msl
index 4053435..5908e18 100644
--- a/test/tint/builtins/gen/var/textureStore/bc1423.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bc1423.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bc1423(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bc1423 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bc1423(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_bc1423
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bc1423(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_bc1423
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bc1423(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_bc1423
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bcc97a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bcc97a.wgsl.expected.ir.msl
index 40aaf04..6eb6244 100644
--- a/test/tint/builtins/gen/var/textureStore/bcc97a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bcc97a.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bcc97a(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bcc97a = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bcc97a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_bcc97a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bcc97a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_bcc97a
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bcc97a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_bcc97a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bd6602.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.ir.msl
index 4a04008..01a36b9 100644
--- a/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_bd6602(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_bd6602 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bd6602(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_bd6602
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bd6602(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_bd6602
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bd6602(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_bd6602
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/be6e30.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/be6e30.wgsl.expected.ir.msl
index 877ebc6..3de57ec 100644
--- a/test/tint/builtins/gen/var/textureStore/be6e30.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/be6e30.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_be6e30(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_be6e30(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_be6e30(tint_module_vars);
+}
+kernel void compute_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_be6e30(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl.expected.ir.msl
index 877ebc6..f15fec3 100644
--- a/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bedbfc(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bedbfc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bedbfc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bedbfc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/bf775c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/bf775c.wgsl.expected.ir.msl
index 877ebc6..87f897f 100644
--- a/test/tint/builtins/gen/var/textureStore/bf775c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/bf775c.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_bf775c(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_bf775c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bf775c(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_bf775c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c06463.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c06463.wgsl.expected.ir.msl
index c1bfa49..93b5583 100644
--- a/test/tint/builtins/gen/var/textureStore/c06463.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c06463.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c06463(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c06463 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c06463(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_c06463
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c06463(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_c06463
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c06463(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_c06463
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c1c664.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c1c664.wgsl.expected.ir.msl
index 9664c4e..b106734 100644
--- a/test/tint/builtins/gen/var/textureStore/c1c664.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c1c664.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c1c664(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c1c664 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1c664(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_c1c664
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1c664(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_c1c664
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1c664(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_c1c664
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c1f29e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl.expected.ir.msl
index 877ebc6..b455600 100644
--- a/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c1f29e(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1f29e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f29e(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f29e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c1f760.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c1f760.wgsl.expected.ir.msl
index 0c47a39..03ee4b2 100644
--- a/test/tint/builtins/gen/var/textureStore/c1f760.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c1f760.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c1f760(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c1f760 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c1f760(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_c1f760
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f760(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_c1f760
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c1f760(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_c1f760
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c2ca46.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl.expected.ir.msl
index 877ebc6..838103e 100644
--- a/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c2ca46(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c2ca46(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c2ca46(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c2ca46(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c32905.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c32905.wgsl.expected.ir.msl
index 877ebc6..54c74cf 100644
--- a/test/tint/builtins/gen/var/textureStore/c32905.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c32905.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c32905(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c32905(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c32905(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c32905(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.ir.msl
index f692c7a..dafab7d 100644
--- a/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c33478(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c33478 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c33478(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_c33478
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c33478(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_c33478
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c33478(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_c33478
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c35268.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c35268.wgsl.expected.ir.msl
index fedc056..be48f9a 100644
--- a/test/tint/builtins/gen/var/textureStore/c35268.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c35268.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c35268(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c35268 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c35268(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_c35268
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c35268(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_c35268
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c35268(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_c35268
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c5af1e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl.expected.ir.msl
index 877ebc6..d55a1e5 100644
--- a/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c5af1e(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c5af1e(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c5af1e(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c5af1e(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c63f05.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c63f05.wgsl.expected.ir.msl
index fa0aeb6..d29605c 100644
--- a/test/tint/builtins/gen/var/textureStore/c63f05.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c63f05.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c63f05(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c63f05 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c63f05(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_c63f05
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c63f05(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_c63f05
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c63f05(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_c63f05
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c79451.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c79451.wgsl.expected.ir.msl
index c549203..d9a3cbf 100644
--- a/test/tint/builtins/gen/var/textureStore/c79451.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c79451.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_c79451(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_c79451 = func():void {
-  $B2: {
-    %arg_1:ptr<function, u32, read_write> = var, 1u
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %6:u32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c79451(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_c79451
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c79451(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_c79451
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c79451(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_c79451
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/c863be.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.ir.msl
index 877ebc6..a471ef82 100644
--- a/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c863be(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  int const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c863be(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c863be(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c863be(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/c9d780.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/c9d780.wgsl.expected.ir.msl
index 877ebc6..cef71a1 100644
--- a/test/tint/builtins/gen/var/textureStore/c9d780.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/c9d780.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_c9d780(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_c9d780(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c9d780(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_c9d780(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl.expected.ir.msl
index 877ebc6..400cfa1 100644
--- a/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_cb3b0b(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_cb3b0b(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cb3b0b(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cb3b0b(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ccac20.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ccac20.wgsl.expected.ir.msl
index f5d4d71..8eb3efa 100644
--- a/test/tint/builtins/gen/var/textureStore/ccac20.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ccac20.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ccac20(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ccac20 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ccac20(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_ccac20
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ccac20(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_ccac20
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ccac20(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_ccac20
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/cd6755.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/cd6755.wgsl.expected.ir.msl
index 877ebc6..388b70a 100644
--- a/test/tint/builtins/gen/var/textureStore/cd6755.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/cd6755.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_cd6755(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_cd6755(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cd6755(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_cd6755(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ceb832.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ceb832.wgsl.expected.ir.msl
index a2cddf8..d10b5f0b 100644
--- a/test/tint/builtins/gen/var/textureStore/ceb832.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ceb832.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ceb832(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ceb832 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ceb832(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_ceb832
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ceb832(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_ceb832
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ceb832(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_ceb832
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d0d62c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d0d62c.wgsl.expected.ir.msl
index 8a8aeae5..b347784 100644
--- a/test/tint/builtins/gen/var/textureStore/d0d62c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d0d62c.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d0d62c(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d0d62c = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d0d62c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_d0d62c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0d62c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_d0d62c
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0d62c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_d0d62c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d0fadc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d0fadc.wgsl.expected.ir.msl
index 93b597d..873d45f 100644
--- a/test/tint/builtins/gen/var/textureStore/d0fadc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d0fadc.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d0fadc(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d0fadc = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d0fadc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_d0fadc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0fadc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_d0fadc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d0fadc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_d0fadc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d19db4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.ir.msl
index 9731f92..8d163e7 100644
--- a/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d19db4(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d19db4 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d19db4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_d19db4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d19db4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_d19db4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d19db4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_d19db4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d1ab82.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d1ab82.wgsl.expected.ir.msl
index dbf2afd..f274d1b 100644
--- a/test/tint/builtins/gen/var/textureStore/d1ab82.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d1ab82.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d1ab82(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d1ab82 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d1ab82(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_d1ab82
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d1ab82(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_d1ab82
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d1ab82(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_d1ab82
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d26166.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d26166.wgsl.expected.ir.msl
index 877ebc6..fa30962 100644
--- a/test/tint/builtins/gen/var/textureStore/d26166.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d26166.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d26166(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d26166(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d26166(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d26166(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d2b565.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d2b565.wgsl.expected.ir.msl
index 877ebc6..d4251fb 100644
--- a/test/tint/builtins/gen/var/textureStore/d2b565.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d2b565.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d2b565(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d2b565(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d2b565(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d2b565(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d3a22b.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d3a22b.wgsl.expected.ir.msl
index b549a6d..8a6c470 100644
--- a/test/tint/builtins/gen/var/textureStore/d3a22b.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d3a22b.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d3a22b(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d3a22b = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d3a22b(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_d3a22b
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d3a22b(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_d3a22b
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d3a22b(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_d3a22b
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/d4aa95.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl.expected.ir.msl
index 877ebc6..7531e28 100644
--- a/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d4aa95(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d4aa95(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d4aa95(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d4aa95(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d55e65.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d55e65.wgsl.expected.ir.msl
index 877ebc6..bb36ac6 100644
--- a/test/tint/builtins/gen/var/textureStore/d55e65.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d55e65.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d55e65(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d55e65(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d55e65(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d55e65(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.ir.msl
index 877ebc6..56b0acf 100644
--- a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d73b5c(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d73b5c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d73b5c(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d73b5c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.ir.msl
index 877ebc6..118dfdd 100644
--- a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_d82b0a(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d82b0a(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d82b0a(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d82b0a(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/d86d33.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/d86d33.wgsl.expected.ir.msl
index 55e1d40..75955be 100644
--- a/test/tint/builtins/gen/var/textureStore/d86d33.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/d86d33.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_d86d33(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_d86d33 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_d86d33(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_d86d33
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d86d33(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_d86d33
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_d86d33(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_d86d33
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/da530c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/da530c.wgsl.expected.ir.msl
index 4119885..6a51f1c 100644
--- a/test/tint/builtins/gen/var/textureStore/da530c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/da530c.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_da530c(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_da530c = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_da530c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_da530c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_da530c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_da530c
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_da530c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_da530c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/db5128.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/db5128.wgsl.expected.ir.msl
index 1e12a3d..9042c5a 100644
--- a/test/tint/builtins/gen/var/textureStore/db5128.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/db5128.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_db5128(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_db5128 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_db5128(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_db5128
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db5128(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_db5128
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db5128(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_db5128
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/db92a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/db92a2.wgsl.expected.ir.msl
index 877ebc6..5ed77da 100644
--- a/test/tint/builtins/gen/var/textureStore/db92a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/db92a2.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_db92a2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_db92a2(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db92a2(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_db92a2(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/dce0e2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dce0e2.wgsl.expected.ir.msl
index cf76d73..1f219c2 100644
--- a/test/tint/builtins/gen/var/textureStore/dce0e2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dce0e2.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<r32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_dce0e2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_dce0e2 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dce0e2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_dce0e2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dce0e2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_dce0e2
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dce0e2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_dce0e2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/dd7d81.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl.expected.ir.msl
index 877ebc6..704cb10 100644
--- a/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dd7d81(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dd7d81(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd7d81(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd7d81(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/dd8b29.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dd8b29.wgsl.expected.ir.msl
index 3609c74..3a8b382 100644
--- a/test/tint/builtins/gen/var/textureStore/dd8b29.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dd8b29.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_dd8b29(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_dd8b29 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dd8b29(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_dd8b29
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd8b29(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_dd8b29
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dd8b29(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_dd8b29
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/dde364.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.ir.msl
index 877ebc6..0de8d3e 100644
--- a/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dde364(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  int const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dde364(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dde364(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dde364(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/de38e5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/de38e5.wgsl.expected.ir.msl
index e86a4f9..573a6da 100644
--- a/test/tint/builtins/gen/var/textureStore/de38e5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/de38e5.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_de38e5(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_de38e5 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_de38e5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_de38e5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de38e5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_de38e5
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de38e5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_de38e5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/de4b94.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/de4b94.wgsl.expected.ir.msl
index 877ebc6..b5b7d36 100644
--- a/test/tint/builtins/gen/var/textureStore/de4b94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/de4b94.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_de4b94(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_de4b94(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de4b94(tint_module_vars);
+}
+kernel void compute_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_de4b94(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/df0c51.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/df0c51.wgsl.expected.ir.msl
index fa083ce..eee0db1 100644
--- a/test/tint/builtins/gen/var/textureStore/df0c51.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/df0c51.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_df0c51(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_df0c51 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<u32>, read_write> = var, vec3<u32>(1u)
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %6:vec3<u32> = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_df0c51(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_df0c51
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df0c51(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_df0c51
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df0c51(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_df0c51
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/df2ca4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl.expected.ir.msl
index 877ebc6..73d2fd0 100644
--- a/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_df2ca4(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_df2ca4(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df2ca4(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_df2ca4(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.ir.msl
index 877ebc6..b159258 100644
--- a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dfa9a1(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dfa9a1(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dfa9a1(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dfa9a1(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.ir.msl
index 877ebc6..b98ce0b 100644
--- a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_dffb13(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_dffb13(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dffb13(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_dffb13(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.ir.msl
index 3778928..7fe954f 100644
--- a/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e077e7(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e077e7 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e077e7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_e077e7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e077e7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_e077e7
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e077e7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_e077e7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e0b666.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e0b666.wgsl.expected.ir.msl
index 877ebc6..41c39f3f 100644
--- a/test/tint/builtins/gen/var/textureStore/e0b666.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e0b666.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e0b666(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e0b666(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e0b666(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e0b666(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/e1784d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e1784d.wgsl.expected.ir.msl
index 06d5068..a5d8e38 100644
--- a/test/tint/builtins/gen/var/textureStore/e1784d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e1784d.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e1784d(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e1784d = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e1784d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_e1784d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e1784d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_e1784d
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e1784d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_e1784d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e38281.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e38281.wgsl.expected.ir.msl
index 877ebc6..f540179 100644
--- a/test/tint/builtins/gen/var/textureStore/e38281.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e38281.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e38281(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e38281(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e38281(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e38281(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/e46fd8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e46fd8.wgsl.expected.ir.msl
index 48ef92f..d45c0b8 100644
--- a/test/tint/builtins/gen/var/textureStore/e46fd8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e46fd8.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<bgra8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e46fd8(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e46fd8 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %6:vec2<u32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e46fd8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_e46fd8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e46fd8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_e46fd8
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e46fd8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_e46fd8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e72bdc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e72bdc.wgsl.expected.ir.msl
index 2c62ba2..4087351 100644
--- a/test/tint/builtins/gen/var/textureStore/e72bdc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e72bdc.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba16float, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e72bdc(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  uint const v = arg_2;
+  float4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e72bdc = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e72bdc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_e72bdc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e72bdc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_e72bdc
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e72bdc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_e72bdc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e7c6d8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl.expected.ir.msl
index 877ebc6..a8e57c3 100644
--- a/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e7c6d8(tint_module_vars_struct tint_module_vars) {
+  uint arg_1 = 1u;
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e7c6d8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e7c6d8(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e7c6d8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/e87f6e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e87f6e.wgsl.expected.ir.msl
index 4b22641..4dff33b 100644
--- a/test/tint/builtins/gen/var/textureStore/e87f6e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e87f6e.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_e87f6e(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_e87f6e = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e87f6e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_e87f6e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e87f6e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_e87f6e
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e87f6e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_e87f6e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/e885e8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e885e8.wgsl.expected.ir.msl
index 877ebc6..bd26d33 100644
--- a/test/tint/builtins/gen/var/textureStore/e885e8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e885e8.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e885e8(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e885e8(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e885e8(tint_module_vars);
+}
+kernel void compute_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e885e8(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl.expected.ir.msl
index 877ebc6..3f01f088 100644
--- a/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_e8cbf7(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint4 arg_2 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_e8cbf7(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e8cbf7(tint_module_vars);
+}
+kernel void compute_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_e8cbf7(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.ir.msl
index 62be2a5..4204046 100644
--- a/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rg32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ea30d2(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ea30d2 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ea30d2(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_ea30d2
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ea30d2(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_ea30d2
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ea30d2(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_ea30d2
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/eb702f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/eb702f.wgsl.expected.ir.msl
index 877ebc6..df2406c 100644
--- a/test/tint/builtins/gen/var/textureStore/eb702f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/eb702f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_eb702f(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_eb702f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb702f(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb702f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl.expected.ir.msl
index 877ebc6..a68d4d4 100644
--- a/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_eb78b9(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_eb78b9(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb78b9(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_eb78b9(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.ir.msl
index ca81700..98816b7 100644
--- a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_3d<r8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ed6198(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ed6198 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec3<i32>, read_write> = var, vec3<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %6:vec3<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ed6198(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_ed6198
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ed6198(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_ed6198
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ed6198(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_ed6198
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/ee6acc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.ir.msl
index 877ebc6..03d2e1a 100644
--- a/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ee6acc(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ee6acc(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ee6acc(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ee6acc(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl.expected.ir.msl
index 877ebc6..e93739e 100644
--- a/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_ef9f2f(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ef9f2f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ef9f2f(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ef9f2f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f05928.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f05928.wgsl.expected.ir.msl
index f8f8682..ca25232 100644
--- a/test/tint/builtins/gen/var/textureStore/f05928.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f05928.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f05928(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  int4 arg_3 = int4(1);
+  uint const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f05928 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, u32, read_write> = var, 1u
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:u32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f05928(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_f05928
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f05928(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_f05928
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f05928(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_f05928
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f1e6d3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl.expected.ir.msl
index 877ebc6..6410612 100644
--- a/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f1e6d3(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  int4 arg_2 = int4(1);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f1e6d3(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f1e6d3(tint_module_vars);
+}
+kernel void compute_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f1e6d3(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f64d69.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f64d69.wgsl.expected.ir.msl
index 485768a..8ebe5b6 100644
--- a/test/tint/builtins/gen/var/textureStore/f64d69.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f64d69.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<r32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f64d69(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  int4 arg_2 = int4(1);
+  int4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f64d69 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %5:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<i32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f64d69(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_f64d69
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f64d69(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_f64d69
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f64d69(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_f64d69
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f6f392.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f6f392.wgsl.expected.ir.msl
index 145d90c..7d199af 100644
--- a/test/tint/builtins/gen/var/textureStore/f6f392.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f6f392.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f6f392(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f6f392 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %6:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<f32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f6f392(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_f6f392
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f6f392(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_f6f392
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f6f392(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_f6f392
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f7b0ab.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.ir.msl
index 877ebc6..0f89d87 100644
--- a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f7b0ab(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  uint arg_2 = 1u;
+  float4 arg_3 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f7b0ab(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f7b0ab(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f7b0ab(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f8aaf9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f8aaf9.wgsl.expected.ir.msl
index 1ed0c01..ed2406a 100644
--- a/test/tint/builtins/gen/var/textureStore/f8aaf9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f8aaf9.wgsl.expected.ir.msl
@@ -1,45 +1,34 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32sint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f8aaf9(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f8aaf9 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<i32>, read_write> = var, vec4<i32>(1i)
-    %6:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %7:vec2<i32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<i32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f8aaf9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_f8aaf9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8aaf9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_f8aaf9
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8aaf9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_f8aaf9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f8dead.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f8dead.wgsl.expected.ir.msl
index 877ebc6..30eab94 100644
--- a/test/tint/builtins/gen/var/textureStore/f8dead.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f8dead.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f8dead(tint_module_vars_struct tint_module_vars) {
+  int3 arg_1 = int3(1);
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint3(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f8dead(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8dead(tint_module_vars);
+}
+kernel void compute_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f8dead(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f975a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f975a0.wgsl.expected.ir.msl
index 8c3de5d..b834ddb 100644
--- a/test/tint/builtins/gen/var/textureStore/f975a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f975a0.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d<rgba8snorm, read_write>, read> = var @binding_point(1, 0)
+void textureStore_f975a0(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  float4 arg_2 = float4(1.0f);
+  float4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint2(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_f975a0 = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<i32>, read_write> = var, vec2<i32>(1i)
-    %arg_2:ptr<function, vec4<f32>, read_write> = var, vec4<f32>(1.0f)
-    %5:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %6:vec2<i32> = load %arg_1
-    %7:vec4<f32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f975a0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_f975a0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f975a0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_f975a0
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f975a0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_f975a0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/f9be83.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.ir.msl
index 877ebc6..b79c5ed 100644
--- a/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_f9be83(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_f9be83(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f9be83(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_f9be83(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl.expected.ir.msl
index 877ebc6..afdf164 100644
--- a/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl.expected.ir.msl
@@ -1,9 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fb9a8f(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fb9a8f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fb9a8f(tint_module_vars);
+}
+kernel void compute_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fb9a8f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl.expected.ir.msl
index 877ebc6..44285f2 100644
--- a/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fbf53f(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  int arg_2 = 1;
+  int4 arg_3 = int4(1);
+  int const v = arg_2;
+  int4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fbf53f(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fbf53f(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fbf53f(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/fc916e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/fc916e.wgsl.expected.ir.msl
index 4453e5c..4504c52 100644
--- a/test/tint/builtins/gen/var/textureStore/fc916e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/fc916e.wgsl.expected.ir.msl
@@ -1,45 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_2d_array<rgba32uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_fc916e(tint_module_vars_struct tint_module_vars) {
+  uint2 arg_1 = uint2(1u);
+  int arg_2 = 1;
+  uint4 arg_3 = uint4(1u);
+  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_fc916e = func():void {
-  $B2: {
-    %arg_1:ptr<function, vec2<u32>, read_write> = var, vec2<u32>(1u)
-    %arg_2:ptr<function, i32, read_write> = var, 1i
-    %arg_3:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %6:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %7:vec2<u32> = load %arg_1
-    %8:i32 = load %arg_2
-    %9:vec4<u32> = load %arg_3
-    %10:void = textureStore %6, %7, %8, %9
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fc916e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %12:void = call %textureStore_fc916e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fc916e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %14:void = call %textureStore_fc916e
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fc916e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %16:void = call %textureStore_fc916e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/fcbe66.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.ir.msl
index 877ebc6..85d5404 100644
--- a/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.ir.msl
@@ -1,9 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture3d<float, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fcbe66(tint_module_vars_struct tint_module_vars) {
+  uint3 arg_1 = uint3(1u);
+  float4 arg_2 = float4(1.0f);
+  tint_module_vars.arg_0.write(arg_2, arg_1);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fcbe66(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fcbe66(tint_module_vars);
+}
+kernel void compute_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fcbe66(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture3d<float, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/fd350c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/fd350c.wgsl.expected.ir.msl
index 877ebc6..5c325d1 100644
--- a/test/tint/builtins/gen/var/textureStore/fd350c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/fd350c.wgsl.expected.ir.msl
@@ -1,9 +1,33 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+void textureStore_fd350c(tint_module_vars_struct tint_module_vars) {
+  int2 arg_1 = int2(1);
+  uint arg_2 = 1u;
+  uint4 arg_3 = uint4(1u);
+  uint const v = arg_2;
+  uint4 const v_1 = arg_3;
+  tint_module_vars.arg_0.write(v_1, uint2(arg_1), v);
+}
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_fd350c(tint_module_vars);
+  return float4(0.0f);
+}
+fragment void fragment_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fd350c(tint_module_vars);
+}
+kernel void compute_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_fd350c(tint_module_vars);
+}
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ff23b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureStore/ff23b3.wgsl.expected.ir.msl
index ce9e3bb..fd9b918 100644
--- a/test/tint/builtins/gen/var/textureStore/ff23b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureStore/ff23b3.wgsl.expected.ir.msl
@@ -1,43 +1,32 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %arg_0:ptr<handle, texture_storage_1d<rgba16uint, read_write>, read> = var @binding_point(1, 0)
+void textureStore_ff23b3(tint_module_vars_struct tint_module_vars) {
+  int arg_1 = 1;
+  uint4 arg_2 = uint4(1u);
+  uint4 const v = arg_2;
+  tint_module_vars.arg_0.write(v, uint(arg_1));
+  tint_module_vars.arg_0.fence();
 }
-
-%textureStore_ff23b3 = func():void {
-  $B2: {
-    %arg_1:ptr<function, i32, read_write> = var, 1i
-    %arg_2:ptr<function, vec4<u32>, read_write> = var, vec4<u32>(1u)
-    %5:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %6:i32 = load %arg_1
-    %7:vec4<u32> = load %arg_2
-    %8:void = textureStore %5, %6, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureStore_ff23b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %10:void = call %textureStore_ff23b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ff23b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %12:void = call %textureStore_ff23b3
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  textureStore_ff23b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %14:void = call %textureStore_ff23b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/textureStore/bgraunorm.wgsl.expected.ir.msl b/test/tint/builtins/textureStore/bgraunorm.wgsl.expected.ir.msl
index 877ebc6..951963d 100644
--- a/test/tint/builtins/textureStore/bgraunorm.wgsl.expected.ir.msl
+++ b/test/tint/builtins/textureStore/bgraunorm.wgsl.expected.ir.msl
@@ -1,9 +1,18 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<float, access::write> tex;
+};
+struct vertex_main_outputs {
+  float4 tint_symbol [[position]];
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureStore
-********************************************************************
-*  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.  *
-********************************************************************
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  float4 const value = float4(1.0f, 2.0f, 3.0f, 4.0f);
+  tint_module_vars.tex.write(value, uint2(int2(9, 8)));
+  return float4(0.0f);
+}
+vertex vertex_main_outputs vertex_main(texture2d<float, access::write> tex [[texture(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.tex=tex};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
+}
diff --git a/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.ir.msl b/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.ir.msl
index d480901..c046280 100644
--- a/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.ir.msl
+++ b/test/tint/builtins/textureStore/loop_continuing_read_write_texture.wgsl.expected.ir.msl
@@ -1,43 +1,22 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d<int, access::read_write> tex;
+};
 
-../../src/tint/lang/msl/writer/printer/printer.cc:1164 internal compiler error: $B1: {  # root
-  %tex:ptr<handle, texture_storage_2d<r32sint, read_write>, read> = var @binding_point(0, 2)
-}
-
-%foo = func():void {
-  $B2: {
-    loop [i: $B3, b: $B4, c: $B5] {  # loop_1
-      $B3: {  # initializer
-        %i:ptr<function, i32, read_write> = var, 0i
-        next_iteration  # -> $B4
+void foo(tint_module_vars_struct tint_module_vars) {
+  {
+    int i = 0;
+    while(true) {
+      if ((i < 3)) {
+      } else {
+        break;
       }
-      $B4: {  # body
-        %4:i32 = load %i
-        %5:bool = lt %4, 3i
-        if %5 [t: $B6, f: $B7] {  # if_1
-          $B6: {  # true
-            exit_if  # if_1
-          }
-          $B7: {  # false
-            exit_loop  # loop_1
-          }
-        }
-        continue  # -> $B5
+      {
+        tint_module_vars.tex.write(int4(0), uint2(int2(0)));
+        tint_module_vars.tex.fence();
       }
-      $B5: {  # continuing
-        %6:texture_storage_2d<r32sint, read_write> = load %tex
-        %7:void = textureStore %6, vec2<i32>(0i), vec4<i32>(0i)
-        next_iteration  # -> $B4
-      }
+      continue;
     }
-    ret
   }
 }
-
-invalid access control for storage texture
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_2.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_2.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_3.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_3.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_4.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_4.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_5.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_5.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_5.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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_6.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_6.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_6.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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_7.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_Variable_7.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Arity_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_SameSignedness_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_ConvertTexelOperand_Signedness_AndWidening_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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/ImageWrite_OptionalParams_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageWrite_OptionalParams_SpvParserHandleTest_ImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/ImageWrite_OptionalParams_SpvParserHandleTest_ImageAccessTest_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: textureStore
-********************************************************************
-*  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_RawImage_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_RawImage_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_RawImage_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: textureStore
-********************************************************************
-*  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/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.ir.msl b/test/tint/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.spvasm.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/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: textureStore
-********************************************************************
-*  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/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.ir.msl b/test/tint/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.expected.ir.msl
deleted file mode 100644
index 877ebc6..0000000
--- a/test/tint/vk-gl-cts/spirv_assembly/instruction/terminate_invocation/no_image_store/1.wgsl.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: textureStore
-********************************************************************
-*  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.  *
-********************************************************************