[msl] Emit read_write access for storage textures

Bug: 42251016
Change-Id: Ida58b11fb5f89a316fdbaae5e00167f64c02fc57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/192781
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index 2617d6d..1ed24b8 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -1241,6 +1241,8 @@
                 std::string access_str;
                 if (storage->access() == core::Access::kRead) {
                     out << "access::read";
+                } else if (storage->access() == core::Access::kReadWrite) {
+                    out << "access::read_write";
                 } else if (storage->access() == core::Access::kWrite) {
                     out << "access::write";
                 } else {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.ir.msl
index 4ef958d..667175c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_01e21e(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_01e21e = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_01e21e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_01e21e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01e21e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_01e21e
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01e21e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_01e21e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/01edb1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/01edb1.wgsl.expected.ir.msl
index 76d62ec..3cd6284 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/01edb1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/01edb1.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_01edb1(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_01edb1 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_01edb1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_01edb1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01edb1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_01edb1
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01edb1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_01edb1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0276ec.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/0276ec.wgsl.expected.ir.msl
index 4cfbfbf..4cdd1a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0276ec.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0276ec.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0276ec(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0276ec = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0276ec(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0276ec
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0276ec(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0276ec
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0276ec(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0276ec
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/029589.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.ir.msl
index b729de4..0b3c89a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_029589(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_029589 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_029589(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_029589
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_029589(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_029589
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_029589(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_029589
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/033195.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/033195.wgsl.expected.ir.msl
index 66ff65b..8c137ca 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/033195.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/033195.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_033195(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_033195 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_033195(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_033195
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_033195(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_033195
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_033195(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_033195
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/038847.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/038847.wgsl.expected.ir.msl
index 095c18f..4323cd2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/038847.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/038847.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_038847(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_038847 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_038847(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_038847
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_038847(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_038847
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_038847(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_038847
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/03f81e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/03f81e.wgsl.expected.ir.msl
index 2c6ddcf..65d0c8d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/03f81e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/03f81e.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_03f81e(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_03f81e = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_03f81e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_03f81e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_03f81e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_03f81e
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_03f81e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_03f81e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0973c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/0973c9.wgsl.expected.ir.msl
index 939d739..1767e3c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0973c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0973c9.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0973c9(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0973c9 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0973c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0973c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0973c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0973c9
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0973c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0973c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0de70c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/0de70c.wgsl.expected.ir.msl
index 6abd491..c44ec81 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0de70c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0de70c.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0de70c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0de70c = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0de70c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0de70c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0de70c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0de70c
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0de70c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0de70c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/18160d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.ir.msl
index 6c1d710..ec3a835 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_18160d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_18160d = func():void {
-  $B2: {
-    %4:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_18160d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_18160d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_18160d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_18160d
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_18160d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_18160d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/1e4024.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/1e4024.wgsl.expected.ir.msl
index e098f08..f20971d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1e4024.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1e4024.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_1e4024(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_1e4024 = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_1e4024(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_1e4024
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_1e4024(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_1e4024
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_1e4024(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_1e4024
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/20eaad.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/20eaad.wgsl.expected.ir.msl
index f40f3ce..e3da7b7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/20eaad.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/20eaad.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_20eaad(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_20eaad = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_20eaad(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_20eaad
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20eaad(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_20eaad
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20eaad(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_20eaad
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/20ecef.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/20ecef.wgsl.expected.ir.msl
index a316b4f..4718bf2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/20ecef.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/20ecef.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_20ecef(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_20ecef = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_20ecef(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_20ecef
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20ecef(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_20ecef
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20ecef(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_20ecef
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/282978.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.ir.msl
index 44c95a1..8bca1f7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_282978(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_282978 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_282978(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_282978
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_282978(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_282978
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_282978(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_282978
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/283b58.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/283b58.wgsl.expected.ir.msl
index e76cc22..0f54989 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/283b58.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/283b58.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_283b58(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_283b58 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_283b58(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_283b58
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_283b58(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_283b58
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_283b58(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_283b58
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/2a58b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/2a58b7.wgsl.expected.ir.msl
index ccf4364..568c2f7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2a58b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2a58b7.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_2a58b7(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_2a58b7 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_2a58b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_2a58b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_2a58b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_2a58b7
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_2a58b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_2a58b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/31d00d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/31d00d.wgsl.expected.ir.msl
index 01b52fd..d921d61 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31d00d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31d00d.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_31d00d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_31d00d = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_31d00d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_31d00d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_31d00d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_31d00d
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_31d00d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_31d00d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/325338.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/325338.wgsl.expected.ir.msl
index 6163677..5a68cfb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/325338.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/325338.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_325338(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_325338 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_325338(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_325338
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_325338(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_325338
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_325338(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_325338
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/36eeb7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/36eeb7.wgsl.expected.ir.msl
index 62d243b..66a8c6c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/36eeb7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/36eeb7.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_36eeb7(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_36eeb7 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_36eeb7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_36eeb7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_36eeb7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_36eeb7
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_36eeb7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_36eeb7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/3834f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/3834f8.wgsl.expected.ir.msl
index 258694e..2d49d3f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3834f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3834f8.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_3834f8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_3834f8 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_3834f8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_3834f8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3834f8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_3834f8
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3834f8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_3834f8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/38c9ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/38c9ca.wgsl.expected.ir.msl
index 0a6c1af..a9687ef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/38c9ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/38c9ca.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_38c9ca(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_38c9ca = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_38c9ca(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_38c9ca
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_38c9ca(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_38c9ca
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_38c9ca(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_38c9ca
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/3bf12a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/3bf12a.wgsl.expected.ir.msl
index 6d8c462..b46158d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3bf12a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3bf12a.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_3bf12a(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_3bf12a = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_3bf12a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_3bf12a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3bf12a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_3bf12a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3bf12a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_3bf12a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/427f92.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/427f92.wgsl.expected.ir.msl
index 656fd03..47c2afc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/427f92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/427f92.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_427f92(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_427f92 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_427f92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_427f92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_427f92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_427f92
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_427f92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_427f92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4d27b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/4d27b3.wgsl.expected.ir.msl
index 825c86d..27ab970 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4d27b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4d27b3.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_4d27b3(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4d27b3 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4d27b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4d27b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4d27b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4d27b3
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4d27b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4d27b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4df14c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.ir.msl
index d79244a..6f4b2f6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4df14c.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_4df14c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4df14c = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4df14c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4df14c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4df14c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4df14c
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4df14c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4df14c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4e540a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/4e540a.wgsl.expected.ir.msl
index 17dadcf..a1251dc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4e540a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4e540a.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_4e540a(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4e540a = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4e540a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4e540a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4e540a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4e540a
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4e540a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4e540a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/55fdeb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/55fdeb.wgsl.expected.ir.msl
index 7ca2b12..d9bca4d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/55fdeb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/55fdeb.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_55fdeb(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_55fdeb = func():void {
-  $B2: {
-    %4:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_55fdeb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_55fdeb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_55fdeb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_55fdeb
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_55fdeb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_55fdeb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/5703b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/5703b3.wgsl.expected.ir.msl
index c407cc0..2016236 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5703b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5703b3.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_5703b3(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_5703b3 = func():void {
-  $B2: {
-    %4:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_5703b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_5703b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_5703b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_5703b3
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_5703b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_5703b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/578e75.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.ir.msl
index 2e4dcc34..e7bf9b2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_578e75(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_578e75 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_578e75(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_578e75
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_578e75(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_578e75
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_578e75(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_578e75
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/579eee.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/579eee.wgsl.expected.ir.msl
index 5753859..1ee9b3e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/579eee.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/579eee.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_579eee(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_579eee = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_579eee(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_579eee
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_579eee(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_579eee
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_579eee(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_579eee
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/617dc8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/617dc8.wgsl.expected.ir.msl
index a85f2fe..c2c212e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/617dc8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/617dc8.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_617dc8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_617dc8 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_617dc8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_617dc8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_617dc8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_617dc8
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_617dc8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_617dc8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/70dd33.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/70dd33.wgsl.expected.ir.msl
index 84e759d..e8a672c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/70dd33.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/70dd33.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_70dd33(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_70dd33 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_70dd33(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_70dd33
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_70dd33(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_70dd33
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_70dd33(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_70dd33
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/715917.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/715917.wgsl.expected.ir.msl
index 6e0c466..0a20df5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/715917.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/715917.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_715917(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_715917 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_715917(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_715917
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_715917(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_715917
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_715917(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_715917
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/740e7c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.ir.msl
index 24b58d8..beb9880 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_740e7c(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_740e7c = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_740e7c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_740e7c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_740e7c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_740e7c
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_740e7c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_740e7c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/795fbb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/795fbb.wgsl.expected.ir.msl
index 265b2d8..4beaf3c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/795fbb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/795fbb.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_795fbb(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_795fbb = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_795fbb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_795fbb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_795fbb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_795fbb
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_795fbb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_795fbb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/7c7c64.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.ir.msl
index 081b6f4..1d9f450 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_7c7c64(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_7c7c64 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_7c7c64(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_7c7c64
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7c7c64(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_7c7c64
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7c7c64(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_7c7c64
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/7ea4b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/7ea4b5.wgsl.expected.ir.msl
index c97f9a9..eaa1db8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7ea4b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7ea4b5.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_7ea4b5(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_7ea4b5 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_7ea4b5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_7ea4b5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7ea4b5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_7ea4b5
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7ea4b5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_7ea4b5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8243a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/8243a1.wgsl.expected.ir.msl
index 1ce6264..f57361f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8243a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8243a1.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8243a1(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8243a1 = func():void {
-  $B2: {
-    %4:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8243a1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8243a1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8243a1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8243a1
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8243a1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8243a1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/835f90.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.ir.msl
index 7cf9323..e287cb3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/835f90.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_835f90(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_835f90 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_835f90(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_835f90
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_835f90(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_835f90
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_835f90(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_835f90
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8a2b17.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/8a2b17.wgsl.expected.ir.msl
index 18da2e6..a82ee9f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a2b17.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a2b17.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_8a2b17(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8a2b17 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8a2b17(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8a2b17
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8a2b17(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8a2b17
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8a2b17(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8a2b17
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8b9906.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/8b9906.wgsl.expected.ir.msl
index 2fc2c6a..f6966b7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8b9906.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8b9906.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8b9906(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8b9906 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8b9906(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8b9906
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8b9906(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8b9906
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8b9906(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8b9906
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8bd369.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/8bd369.wgsl.expected.ir.msl
index 42dbc03..d2d9eb7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8bd369.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8bd369.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8bd369(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8bd369 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8bd369(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8bd369
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8bd369(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8bd369
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8bd369(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8bd369
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/91e3b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.ir.msl
index f4e12c7..4dd7839 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/91e3b4.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_91e3b4(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_91e3b4 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_91e3b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_91e3b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_91e3b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_91e3b4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_91e3b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_91e3b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/9944d5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/9944d5.wgsl.expected.ir.msl
index ef2628f..7b80376 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9944d5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9944d5.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_9944d5(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_9944d5 = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_9944d5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_9944d5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_9944d5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_9944d5
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_9944d5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_9944d5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a105a5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/a105a5.wgsl.expected.ir.msl
index 2655353..2ebcd9d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a105a5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a105a5.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_a105a5(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a105a5 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a105a5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a105a5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a105a5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a105a5
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a105a5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a105a5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a14386.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/a14386.wgsl.expected.ir.msl
index 24e838d..9268257 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a14386.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a14386.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_a14386(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a14386 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a14386(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a14386
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a14386(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a14386
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a14386(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a14386
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a7ae4c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/a7ae4c.wgsl.expected.ir.msl
index 5ff70c5..af8abe4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a7ae4c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a7ae4c.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_a7ae4c(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a7ae4c = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a7ae4c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a7ae4c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a7ae4c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a7ae4c
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a7ae4c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a7ae4c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ae4595.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.ir.msl
index 84b0b21..adfc5e1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ae4595.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ae4595(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ae4595 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ae4595(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ae4595
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae4595(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ae4595
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae4595(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ae4595
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ae75a7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/ae75a7.wgsl.expected.ir.msl
index efbeeed..0e58aba 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ae75a7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ae75a7.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_ae75a7(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ae75a7 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ae75a7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ae75a7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae75a7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ae75a7
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae75a7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ae75a7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b16352.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/b16352.wgsl.expected.ir.msl
index c75fa3e..408d03a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b16352.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b16352.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b16352(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b16352 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b16352(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b16352
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b16352(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b16352
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b16352(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b16352
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b284b8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/b284b8.wgsl.expected.ir.msl
index 55267cb..2fb5086 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b284b8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b284b8.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b284b8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b284b8 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b284b8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b284b8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b284b8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b284b8
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b284b8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b284b8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b5d68e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/b5d68e.wgsl.expected.ir.msl
index 7075ee4..08172b2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b5d68e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b5d68e.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b5d68e(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b5d68e = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b5d68e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b5d68e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b5d68e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b5d68e
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b5d68e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b5d68e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b8287f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/b8287f.wgsl.expected.ir.msl
index 8a9bb43..4ffab41 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b8287f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b8287f.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b8287f(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b8287f = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b8287f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b8287f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b8287f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b8287f
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b8287f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b8287f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/bc96f6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/bc96f6.wgsl.expected.ir.msl
index 0734d41..0f523c1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bc96f6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bc96f6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_bc96f6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_bc96f6 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_bc96f6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_bc96f6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_bc96f6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_bc96f6
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_bc96f6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_bc96f6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c27466.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/c27466.wgsl.expected.ir.msl
index 4d04623..2995f45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c27466.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c27466.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c27466(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c27466 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c27466(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c27466
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c27466(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c27466
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c27466(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c27466
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c6b44c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/c6b44c.wgsl.expected.ir.msl
index c81c192..5d32010 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c6b44c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b44c.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_c6b44c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c6b44c = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c6b44c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c6b44c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b44c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c6b44c
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b44c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c6b44c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c6b985.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.ir.msl
index b645805..8b34ccc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c6b985(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c6b985 = func():void {
-  $B2: {
-    %4:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c6b985(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c6b985
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b985(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c6b985
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b985(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c6b985
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c7ea63.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.ir.msl
index 7be61e1..f0e0761 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c7ea63(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c7ea63 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c7ea63(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c7ea63
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c7ea63(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c7ea63
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c7ea63(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c7ea63
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c82420.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.ir.msl
index a886b56..54565cd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c82420.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_c82420(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c82420 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c82420(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c82420
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c82420(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c82420
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c82420(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c82420
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ca10cc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/ca10cc.wgsl.expected.ir.msl
index d198f46..2626e89 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ca10cc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ca10cc.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ca10cc(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ca10cc = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ca10cc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ca10cc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ca10cc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ca10cc
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ca10cc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ca10cc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/deb3c0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/deb3c0.wgsl.expected.ir.msl
index adf6260..bc9e2d2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/deb3c0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/deb3c0.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_deb3c0(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_deb3c0 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_deb3c0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_deb3c0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_deb3c0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_deb3c0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_deb3c0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_deb3c0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e4f021.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/e4f021.wgsl.expected.ir.msl
index 687f5e4..6742ed8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4f021.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4f021.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e4f021(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e4f021 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e4f021(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e4f021
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e4f021(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e4f021
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e4f021(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e4f021
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e50eb8.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/e50eb8.wgsl.expected.ir.msl
index 015b749..9acd111 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e50eb8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e50eb8.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e50eb8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e50eb8 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e50eb8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e50eb8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e50eb8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e50eb8
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e50eb8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e50eb8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e824b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.ir.msl
index f8c1124..fab18b6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e824b6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e824b6 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e824b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e824b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e824b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e824b6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e824b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e824b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb10d6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/eb10d6.wgsl.expected.ir.msl
index 009453b..99d4426 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb10d6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb10d6.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb10d6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb10d6 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb10d6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb10d6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb10d6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb10d6
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb10d6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb10d6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb1249.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/eb1249.wgsl.expected.ir.msl
index 1f20f91..8758c69 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb1249.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb1249.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb1249(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb1249 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb1249(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb1249
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb1249(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb1249
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb1249(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb1249
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb9f4d.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/eb9f4d.wgsl.expected.ir.msl
index 92df375..abd846c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb9f4d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb9f4d.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb9f4d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb9f4d = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb9f4d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb9f4d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb9f4d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb9f4d
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb9f4d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb9f4d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ed1030.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/ed1030.wgsl.expected.ir.msl
index 74ea7f7..9541a0d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ed1030.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ed1030.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ed1030(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ed1030 = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ed1030(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ed1030
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ed1030(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ed1030
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ed1030(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ed1030
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f406ff.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/f406ff.wgsl.expected.ir.msl
index 77a9dc8..0142ef4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f406ff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f406ff.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_f406ff(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f406ff = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f406ff(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f406ff
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f406ff(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f406ff
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f406ff(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f406ff
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f55a94.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/f55a94.wgsl.expected.ir.msl
index 157d160..67f986b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f55a94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f55a94.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f55a94(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f55a94 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f55a94(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f55a94
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f55a94(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f55a94
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f55a94(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f55a94
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f93ece.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/f93ece.wgsl.expected.ir.msl
index f0c1f58..9fb5644 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f93ece.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f93ece.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f93ece(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f93ece = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f93ece(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f93ece
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f93ece(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f93ece
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f93ece(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f93ece
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f94e55.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.ir.msl
index 1b8912c..b3c546f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f94e55.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f94e55(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f94e55 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f94e55(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f94e55
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f94e55(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f94e55
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f94e55(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f94e55
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/01e21e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.ir.msl
index 4ef958d..667175c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_01e21e(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_01e21e = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_01e21e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_01e21e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01e21e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_01e21e
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01e21e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_01e21e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/01edb1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/01edb1.wgsl.expected.ir.msl
index 76d62ec..3cd6284 100644
--- a/test/tint/builtins/gen/var/textureDimensions/01edb1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/01edb1.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_01edb1(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_01edb1 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_01edb1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_01edb1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01edb1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_01edb1
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_01edb1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_01edb1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0276ec.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/0276ec.wgsl.expected.ir.msl
index 4cfbfbf..4cdd1a4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0276ec.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0276ec.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0276ec(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0276ec = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0276ec(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0276ec
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0276ec(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0276ec
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0276ec(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0276ec
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/029589.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.ir.msl
index b729de4..0b3c89a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_029589(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_029589 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_029589(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_029589
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_029589(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_029589
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_029589(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_029589
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/033195.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/033195.wgsl.expected.ir.msl
index 66ff65b..8c137ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/033195.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/033195.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_033195(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_033195 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_033195(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_033195
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_033195(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_033195
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_033195(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_033195
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/038847.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/038847.wgsl.expected.ir.msl
index 095c18f..4323cd2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/038847.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/038847.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_038847(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_038847 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_038847(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_038847
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_038847(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_038847
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_038847(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_038847
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/03f81e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/03f81e.wgsl.expected.ir.msl
index 2c6ddcf..65d0c8d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/03f81e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/03f81e.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_03f81e(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_03f81e = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8snorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_03f81e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_03f81e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_03f81e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_03f81e
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_03f81e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_03f81e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0973c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/0973c9.wgsl.expected.ir.msl
index 939d739..1767e3c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0973c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0973c9.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0973c9(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0973c9 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0973c9(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0973c9
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0973c9(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0973c9
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0973c9(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0973c9
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/0de70c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/0de70c.wgsl.expected.ir.msl
index 6abd491..c44ec81 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0de70c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0de70c.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_0de70c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_0de70c = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_0de70c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_0de70c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0de70c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_0de70c
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_0de70c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_0de70c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/18160d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.ir.msl
index 6c1d710..ec3a835 100644
--- a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_18160d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_18160d = func():void {
-  $B2: {
-    %4:texture_storage_2d<r8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_18160d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_18160d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_18160d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_18160d
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_18160d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_18160d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/1e4024.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/1e4024.wgsl.expected.ir.msl
index e098f08..f20971d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1e4024.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/1e4024.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_1e4024(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_1e4024 = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_1e4024(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_1e4024
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_1e4024(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_1e4024
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_1e4024(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_1e4024
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/20eaad.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/20eaad.wgsl.expected.ir.msl
index f40f3ce..e3da7b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/20eaad.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/20eaad.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_20eaad(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_20eaad = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_20eaad(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_20eaad
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20eaad(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_20eaad
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20eaad(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_20eaad
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/20ecef.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/20ecef.wgsl.expected.ir.msl
index a316b4f..4718bf2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/20ecef.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/20ecef.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_20ecef(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_20ecef = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_20ecef(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_20ecef
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20ecef(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_20ecef
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_20ecef(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_20ecef
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/282978.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.ir.msl
index 44c95a1..8bca1f7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_282978(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_282978 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_282978(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_282978
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_282978(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_282978
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_282978(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_282978
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/283b58.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/283b58.wgsl.expected.ir.msl
index e76cc22..0f54989 100644
--- a/test/tint/builtins/gen/var/textureDimensions/283b58.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/283b58.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_283b58(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_283b58 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_283b58(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_283b58
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_283b58(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_283b58
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_283b58(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_283b58
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/2a58b7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/2a58b7.wgsl.expected.ir.msl
index ccf4364..568c2f7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2a58b7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/2a58b7.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_2a58b7(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_2a58b7 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_2a58b7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_2a58b7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_2a58b7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_2a58b7
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_2a58b7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_2a58b7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/31d00d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/31d00d.wgsl.expected.ir.msl
index 01b52fd..d921d61 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31d00d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/31d00d.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_31d00d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_31d00d = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_31d00d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_31d00d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_31d00d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_31d00d
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_31d00d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_31d00d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/325338.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/325338.wgsl.expected.ir.msl
index 6163677..5a68cfb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/325338.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/325338.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_325338(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_325338 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_325338(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_325338
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_325338(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_325338
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_325338(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_325338
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/36eeb7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/36eeb7.wgsl.expected.ir.msl
index 62d243b..66a8c6c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/36eeb7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/36eeb7.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_36eeb7(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_36eeb7 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_36eeb7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_36eeb7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_36eeb7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_36eeb7
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_36eeb7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_36eeb7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/3834f8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/3834f8.wgsl.expected.ir.msl
index 258694e..2d49d3f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3834f8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3834f8.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_3834f8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_3834f8 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_3834f8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_3834f8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3834f8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_3834f8
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3834f8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_3834f8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/38c9ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/38c9ca.wgsl.expected.ir.msl
index 0a6c1af..a9687ef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/38c9ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/38c9ca.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_38c9ca(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_38c9ca = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_38c9ca(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_38c9ca
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_38c9ca(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_38c9ca
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_38c9ca(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_38c9ca
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/3bf12a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/3bf12a.wgsl.expected.ir.msl
index 6d8c462..b46158d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3bf12a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3bf12a.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_3bf12a(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_3bf12a = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_3bf12a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_3bf12a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3bf12a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_3bf12a
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_3bf12a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_3bf12a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/427f92.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/427f92.wgsl.expected.ir.msl
index 656fd03..47c2afc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/427f92.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/427f92.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_427f92(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_427f92 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba16uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_427f92(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_427f92
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_427f92(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_427f92
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_427f92(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_427f92
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4d27b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/4d27b3.wgsl.expected.ir.msl
index 825c86d..27ab970 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4d27b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4d27b3.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_4d27b3(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4d27b3 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4d27b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4d27b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4d27b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4d27b3
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4d27b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4d27b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4df14c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.ir.msl
index d79244a..6f4b2f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4df14c.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_4df14c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4df14c = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4df14c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4df14c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4df14c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4df14c
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4df14c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4df14c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/4e540a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/4e540a.wgsl.expected.ir.msl
index 17dadcf..a1251dc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4e540a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4e540a.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_4e540a(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_4e540a = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_4e540a(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_4e540a
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4e540a(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_4e540a
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_4e540a(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_4e540a
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/55fdeb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/55fdeb.wgsl.expected.ir.msl
index 7ca2b12..d9bca4d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/55fdeb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/55fdeb.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_55fdeb(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_55fdeb = func():void {
-  $B2: {
-    %4:texture_storage_2d<bgra8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_55fdeb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_55fdeb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_55fdeb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_55fdeb
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_55fdeb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_55fdeb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/5703b3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/5703b3.wgsl.expected.ir.msl
index c407cc0..2016236 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5703b3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/5703b3.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_5703b3(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_5703b3 = func():void {
-  $B2: {
-    %4:texture_storage_1d<bgra8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_5703b3(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_5703b3
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_5703b3(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_5703b3
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_5703b3(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_5703b3
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/578e75.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.ir.msl
index 2e4dcc34..e7bf9b2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_578e75(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_578e75 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_578e75(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_578e75
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_578e75(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_578e75
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_578e75(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_578e75
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/579eee.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/579eee.wgsl.expected.ir.msl
index 5753859..1ee9b3e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/579eee.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/579eee.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_579eee(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_579eee = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_579eee(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_579eee
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_579eee(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_579eee
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_579eee(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_579eee
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/617dc8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/617dc8.wgsl.expected.ir.msl
index a85f2fe..c2c212e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/617dc8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/617dc8.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_617dc8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_617dc8 = func():void {
-  $B2: {
-    %4:texture_storage_3d<r32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_617dc8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_617dc8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_617dc8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_617dc8
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_617dc8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_617dc8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/70dd33.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/70dd33.wgsl.expected.ir.msl
index 84e759d..e8a672c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/70dd33.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/70dd33.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_70dd33(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_70dd33 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_70dd33(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_70dd33
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_70dd33(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_70dd33
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_70dd33(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_70dd33
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/715917.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/715917.wgsl.expected.ir.msl
index 6e0c466..0a20df5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/715917.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/715917.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_715917(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_715917 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<bgra8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_715917(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_715917
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_715917(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_715917
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_715917(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_715917
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/740e7c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.ir.msl
index 24b58d8..beb9880 100644
--- a/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_740e7c(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_740e7c = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_740e7c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_740e7c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_740e7c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_740e7c
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_740e7c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_740e7c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/795fbb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/795fbb.wgsl.expected.ir.msl
index 265b2d8..4beaf3c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/795fbb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/795fbb.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_795fbb(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_795fbb = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_795fbb(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_795fbb
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_795fbb(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_795fbb
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_795fbb(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_795fbb
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/7c7c64.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.ir.msl
index 081b6f4..1d9f450 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_7c7c64(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_7c7c64 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_7c7c64(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_7c7c64
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7c7c64(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_7c7c64
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7c7c64(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_7c7c64
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/7ea4b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/7ea4b5.wgsl.expected.ir.msl
index c97f9a9..eaa1db8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7ea4b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/7ea4b5.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_7ea4b5(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_7ea4b5 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_7ea4b5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_7ea4b5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7ea4b5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_7ea4b5
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_7ea4b5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_7ea4b5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8243a1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/8243a1.wgsl.expected.ir.msl
index 1ce6264..f57361f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8243a1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8243a1.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8243a1(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8243a1 = func():void {
-  $B2: {
-    %4:texture_storage_3d<bgra8unorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8243a1(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8243a1
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8243a1(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8243a1
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8243a1(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8243a1
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/835f90.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.ir.msl
index 7cf9323..e287cb3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/835f90.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_835f90(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_835f90 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_835f90(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_835f90
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_835f90(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_835f90
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_835f90(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_835f90
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8a2b17.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/8a2b17.wgsl.expected.ir.msl
index 18da2e6..a82ee9f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a2b17.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a2b17.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_8a2b17(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8a2b17 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8a2b17(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8a2b17
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8a2b17(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8a2b17
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8a2b17(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8a2b17
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8b9906.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/8b9906.wgsl.expected.ir.msl
index 2fc2c6a..f6966b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8b9906.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8b9906.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8b9906(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8b9906 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8b9906(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8b9906
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8b9906(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8b9906
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8b9906(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8b9906
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/8bd369.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/8bd369.wgsl.expected.ir.msl
index 42dbc03..d2d9eb7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8bd369.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8bd369.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_8bd369(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_8bd369 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8snorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_8bd369(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_8bd369
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8bd369(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_8bd369
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_8bd369(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_8bd369
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/91e3b4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.ir.msl
index f4e12c7..4dd7839 100644
--- a/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/91e3b4.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_91e3b4(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_91e3b4 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32sint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_91e3b4(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_91e3b4
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_91e3b4(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_91e3b4
-    ret
-  }
+kernel void compute_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_91e3b4(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_91e3b4
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<int, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/9944d5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/9944d5.wgsl.expected.ir.msl
index ef2628f..7b80376 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9944d5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9944d5.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_9944d5(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_9944d5 = func():void {
-  $B2: {
-    %4:texture_storage_1d<r32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_9944d5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_9944d5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_9944d5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_9944d5
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_9944d5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_9944d5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a105a5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/a105a5.wgsl.expected.ir.msl
index 2655353..2ebcd9d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a105a5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a105a5.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_a105a5(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a105a5 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32uint, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a105a5(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a105a5
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a105a5(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a105a5
-    ret
-  }
+kernel void compute_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a105a5(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a105a5
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<uint, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a14386.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/a14386.wgsl.expected.ir.msl
index 24e838d..9268257 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a14386.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a14386.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_a14386(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a14386 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a14386(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a14386
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a14386(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a14386
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a14386(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a14386
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/a7ae4c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/a7ae4c.wgsl.expected.ir.msl
index 5ff70c5..af8abe4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a7ae4c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a7ae4c.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_a7ae4c(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_a7ae4c = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8snorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_a7ae4c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_a7ae4c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a7ae4c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_a7ae4c
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_a7ae4c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_a7ae4c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ae4595.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.ir.msl
index 84b0b21..adfc5e1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ae4595.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ae4595(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ae4595 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rg32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ae4595(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ae4595
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae4595(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ae4595
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae4595(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ae4595
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ae75a7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/ae75a7.wgsl.expected.ir.msl
index efbeeed..0e58aba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ae75a7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ae75a7.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_ae75a7(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ae75a7 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ae75a7(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ae75a7
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae75a7(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ae75a7
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ae75a7(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ae75a7
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b16352.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/b16352.wgsl.expected.ir.msl
index c75fa3e..408d03a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b16352.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b16352.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b16352(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b16352 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba16sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b16352(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b16352
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b16352(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b16352
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b16352(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b16352
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b284b8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/b284b8.wgsl.expected.ir.msl
index 55267cb..2fb5086 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b284b8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b284b8.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b284b8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b284b8 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b284b8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b284b8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b284b8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b284b8
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b284b8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b284b8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b5d68e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/b5d68e.wgsl.expected.ir.msl
index 7075ee4..08172b2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b5d68e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b5d68e.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b5d68e(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b5d68e = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b5d68e(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b5d68e
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b5d68e(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b5d68e
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b5d68e(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b5d68e
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/b8287f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/b8287f.wgsl.expected.ir.msl
index 8a9bb43..4ffab41 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b8287f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b8287f.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_b8287f(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_b8287f = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<r32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_b8287f(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_b8287f
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b8287f(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_b8287f
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_b8287f(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_b8287f
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/bc96f6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/bc96f6.wgsl.expected.ir.msl
index 0734d41..0f523c1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bc96f6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/bc96f6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<float, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_bc96f6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_bc96f6 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_bc96f6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_bc96f6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_bc96f6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_bc96f6
-    ret
-  }
+kernel void compute_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_bc96f6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_bc96f6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c27466.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/c27466.wgsl.expected.ir.msl
index 4d04623..2995f45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c27466.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c27466.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<int, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c27466(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c27466 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba16sint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c27466(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c27466
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c27466(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c27466
-    ret
-  }
+kernel void compute_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c27466(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c27466
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<int, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c6b44c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/c6b44c.wgsl.expected.ir.msl
index c81c192..5d32010 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c6b44c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b44c.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_c6b44c(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c6b44c = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c6b44c(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c6b44c
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b44c(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c6b44c
-    ret
-  }
+kernel void compute_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b44c(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c6b44c
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c6b985.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.ir.msl
index b645805..8b34ccc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c6b985(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c6b985 = func():void {
-  $B2: {
-    %4:texture_storage_1d<r8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c6b985(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c6b985
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b985(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c6b985
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c6b985(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c6b985
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c7ea63.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.ir.msl
index 7be61e1..f0e0761 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_c7ea63(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c7ea63 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rg32float, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c7ea63(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c7ea63
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c7ea63(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c7ea63
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c7ea63(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c7ea63
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/c82420.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.ir.msl
index a886b56..54565cd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c82420.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_c82420(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_c82420 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_c82420(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_c82420
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c82420(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_c82420
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_c82420(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_c82420
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ca10cc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/ca10cc.wgsl.expected.ir.msl
index d198f46..2626e89 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ca10cc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ca10cc.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ca10cc(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ca10cc = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ca10cc(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ca10cc
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ca10cc(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ca10cc
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ca10cc(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ca10cc
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/deb3c0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/deb3c0.wgsl.expected.ir.msl
index adf6260..bc9e2d2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/deb3c0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/deb3c0.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_deb3c0(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_deb3c0 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba16float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_deb3c0(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_deb3c0
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_deb3c0(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_deb3c0
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_deb3c0(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_deb3c0
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e4f021.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/e4f021.wgsl.expected.ir.msl
index 687f5e4..6742ed8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4f021.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4f021.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e4f021(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e4f021 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e4f021(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e4f021
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e4f021(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e4f021
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e4f021(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e4f021
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e50eb8.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/e50eb8.wgsl.expected.ir.msl
index 015b749..9acd111 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e50eb8.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e50eb8.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e50eb8(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e50eb8 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e50eb8(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e50eb8
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e50eb8(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e50eb8
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e50eb8(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e50eb8
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/e824b6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.ir.msl
index f8c1124..fab18b6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<uint, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_e824b6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_e824b6 = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rg32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_e824b6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_e824b6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e824b6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_e824b6
-    ret
-  }
+kernel void compute_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_e824b6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_e824b6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb10d6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/eb10d6.wgsl.expected.ir.msl
index 009453b..99d4426 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb10d6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb10d6.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb10d6(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb10d6 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rgba8unorm, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb10d6(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb10d6
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb10d6(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb10d6
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb10d6(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb10d6
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb1249.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/eb1249.wgsl.expected.ir.msl
index 1f20f91..8758c69 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb1249.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb1249.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<uint, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb1249(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb1249 = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba32uint, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb1249(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb1249
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb1249(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb1249
-    ret
-  }
+kernel void compute_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb1249(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb1249
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<uint, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/eb9f4d.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/eb9f4d.wgsl.expected.ir.msl
index 92df375..abd846c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb9f4d.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb9f4d.wgsl.expected.ir.msl
@@ -1,43 +1,31 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture2d_array<int, access::read_write> arg_0;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_eb9f4d(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_eb9f4d = func():void {
-  $B2: {
-    %4:texture_storage_2d_array<rgba8sint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_eb9f4d(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_eb9f4d
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb9f4d(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_eb9f4d
-    ret
-  }
+kernel void compute_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_eb9f4d(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_eb9f4d
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d_array<int, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/ed1030.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/ed1030.wgsl.expected.ir.msl
index 74ea7f7..9541a0d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ed1030.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ed1030.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_ed1030(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_ed1030 = func():void {
-  $B2: {
-    %4:texture_storage_2d<r32uint, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_ed1030(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_ed1030
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ed1030(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_ed1030
-    ret
-  }
+kernel void compute_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_ed1030(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_ed1030
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<uint, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f406ff.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/f406ff.wgsl.expected.ir.msl
index 77a9dc8..0142ef4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f406ff.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f406ff.wgsl.expected.ir.msl
@@ -1,43 +1,30 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+  texture1d<float, access::read_write> arg_0;
+  device uint* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, u32, read_write> = var @binding_point(2, 0)
+void textureDimensions_f406ff(tint_module_vars_struct tint_module_vars) {
+  uint res = uint(tint_module_vars.arg_0.get_width());
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f406ff = func():void {
-  $B2: {
-    %4:texture_storage_1d<rgba8unorm, read_write> = load %arg_0
-    %5:u32 = textureDimensions %4
-    %res:ptr<function, u32, read_write> = var, %5
-    %7:u32 = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f406ff(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f406ff
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f406ff(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f406ff
-    ret
-  }
+kernel void compute_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f406ff(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f406ff
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture1d<float, access::read_write> arg_0 [[texture(0)]], device uint* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f55a94.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/f55a94.wgsl.expected.ir.msl
index 157d160..67f986b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f55a94.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f55a94.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f55a94(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f55a94 = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba8snorm, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f55a94(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f55a94
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f55a94(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f55a94
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f55a94(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f55a94
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f93ece.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/f93ece.wgsl.expected.ir.msl
index f0c1f58..9fb5644 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f93ece.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f93ece.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;
+  device uint3* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec3<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f93ece(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint const v_1 = tint_module_vars.arg_0.get_height(0u);
+  uint3 res = uint3(v, v_1, tint_module_vars.arg_0.get_depth(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f93ece = func():void {
-  $B2: {
-    %4:texture_storage_3d<rgba32float, read_write> = load %arg_0
-    %5:vec3<u32> = textureDimensions %4
-    %res:ptr<function, vec3<u32>, read_write> = var, %5
-    %7:vec3<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f93ece(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f93ece
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f93ece(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f93ece
-    ret
-  }
+kernel void compute_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f93ece(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f93ece
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture3d<float, access::read_write> arg_0 [[texture(0)]], device uint3* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue 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/textureDimensions/f94e55.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.ir.msl
index 1b8912c..b3c546f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f94e55.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;
+  device uint2* prevent_dce;
+};
+struct vertex_main_outputs {
+  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)
-  %prevent_dce:ptr<storage, vec2<u32>, read_write> = var @binding_point(2, 0)
+void textureDimensions_f94e55(tint_module_vars_struct tint_module_vars) {
+  uint const v = tint_module_vars.arg_0.get_width(0u);
+  uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u));
+  (*tint_module_vars.prevent_dce) = res;
 }
-
-%textureDimensions_f94e55 = func():void {
-  $B2: {
-    %4:texture_storage_2d<rg32float, read_write> = load %arg_0
-    %5:vec2<u32> = textureDimensions %4
-    %res:ptr<function, vec2<u32>, read_write> = var, %5
-    %7:vec2<u32> = load %res
-    store %prevent_dce, %7
-    ret
-  }
+float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+  textureDimensions_f94e55(tint_module_vars);
+  return float4(0.0f);
 }
-%vertex_main = @vertex func():vec4<f32> [@position] {
-  $B3: {
-    %9:void = call %textureDimensions_f94e55
-    ret vec4<f32>(0.0f)
-  }
+fragment void fragment_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f94e55(tint_module_vars);
 }
-%fragment_main = @fragment func():void {
-  $B4: {
-    %11:void = call %textureDimensions_f94e55
-    ret
-  }
+kernel void compute_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  textureDimensions_f94e55(tint_module_vars);
 }
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
-  $B5: {
-    %13:void = call %textureDimensions_f94e55
-    ret
-  }
+vertex vertex_main_outputs vertex_main(texture2d<float, access::read_write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) {
+  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce};
+  return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)};
 }
-
-invalid access control for storage texture
-********************************************************************
-*  The tint shader compiler has encountered an unexpected error.   *
-*                                                                  *
-*  Please help us fix this issue by submitting a bug report at     *
-*  crbug.com/tint with the source program that triggered the bug.  *
-********************************************************************