tint/intrinsics: Allow mixing of signed / unsigned integer arguments
Fixed: tint:1733
Change-Id: Id83c5c5a59df062320a9a9fde087a34b85fbaa2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107160
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
index 6d12c78..0f6d84c 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<f32>
fn textureGather_17baac() {
- var res: vec4<f32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
index 25e22eb..e180946 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_17baac() {
- vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_17baac() {
- vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_17baac() {
- vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
index 3e3e581..7734fec 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 48
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -47,8 +47,10 @@
%float_0 = OpConstant %float 0
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %32 = OpTypeFunction %v4float
+ %34 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_17baac = OpFunction %void None %15
%18 = OpLabel
@@ -58,29 +60,29 @@
%23 = OpSampledImage %22 %21 %20
%26 = OpConvertUToF %float %uint_1
%29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
- %19 = OpImageGather %v4float %23 %29 %uint_1
+ %19 = OpImageGather %v4float %23 %29 %int_1
OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureGather_17baac
+%vertex_main_inner = OpFunction %v4float None %34
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureGather_17baac
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %15
- %37 = OpLabel
- %38 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %38
+ %39 = OpLabel
+ %40 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %40
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %15
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureGather_17baac
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureGather_17baac
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %15
- %44 = OpLabel
- %45 = OpFunctionCall %void %textureGather_17baac
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureGather_17baac
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
index 52cc99b..9735392 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_17baac() {
- var res : vec4<f32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl
new file mode 100644
index 0000000..7d9468c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<f32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
+fn textureGather_24b0bd() {
+ var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_24b0bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_24b0bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_24b0bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..68596e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_24b0bd() {
+ float4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_24b0bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_24b0bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_24b0bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..68596e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_24b0bd() {
+ float4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_24b0bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_24b0bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_24b0bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl
new file mode 100644
index 0000000..ee71f66
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_24b0bd() {
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_24b0bd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_24b0bd() {
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_24b0bd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_24b0bd() {
+ vec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_24b0bd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl
new file mode 100644
index 0000000..0cc11c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_24b0bd(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_24b0bd(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_24b0bd(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_24b0bd(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm
new file mode 100644
index 0000000..a3a420b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm
@@ -0,0 +1,88 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 48
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_24b0bd "textureGather_24b0bd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %34 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_24b0bd = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %14 %arg_2
+ %21 = OpLoad %11 %arg_1
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageGather %v4float %23 %29 %uint_1
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %34
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureGather_24b0bd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %40
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureGather_24b0bd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureGather_24b0bd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl
new file mode 100644
index 0000000..46c8b4d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<f32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_24b0bd() {
+ var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_24b0bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_24b0bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_24b0bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl
new file mode 100644
index 0000000..2ad1513
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<i32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<i32>
+fn textureGather_445793() {
+ var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_445793();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_445793();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_445793();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..286350f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_445793() {
+ int4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_445793();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_445793();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_445793();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..286350f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_445793() {
+ int4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_445793();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_445793();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_445793();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl
new file mode 100644
index 0000000..a39af11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_445793() {
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_445793();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_445793() {
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_445793();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_445793() {
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_445793();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl
new file mode 100644
index 0000000..a194b15
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_445793(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ int4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_445793(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_445793(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_445793(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm
new file mode 100644
index 0000000..4af17b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_445793 "textureGather_445793"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %24 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %35 = OpConstantNull %v4int
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_445793 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %35
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %28 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %28
+ %20 = OpImageGather %v4int %25 %30 %uint_1
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_445793
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_445793
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_445793
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl
new file mode 100644
index 0000000..93e20ca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<i32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_445793() {
+ var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_445793();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_445793();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_445793();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
index 851446a..974421c 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<i32>
fn textureGather_4e8ac5() {
- var res: vec4<i32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
index cc5ccde..8495304 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_4e8ac5() {
- ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_4e8ac5() {
- ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_4e8ac5() {
- ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
index 452ff4f..c7ac20a 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -49,41 +49,42 @@
%float_0 = OpConstant %float 0
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %34 = OpConstantNull %v4int
- %35 = OpTypeFunction %v4float
+ %35 = OpConstantNull %v4int
+ %36 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_4e8ac5 = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %34
+ %res = OpVariable %_ptr_Function_v4int Function %35
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%28 = OpConvertUToF %float %uint_1
%31 = OpCompositeConstruct %v3float %float_0 %float_0 %28
- %20 = OpImageGather %v4int %25 %31 %uint_1
+ %20 = OpImageGather %v4int %25 %31 %int_1
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureGather_4e8ac5
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_4e8ac5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %40 = OpLabel
- %41 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %41
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %44 = OpLabel
- %45 = OpFunctionCall %void %textureGather_4e8ac5
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_4e8ac5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %47 = OpLabel
- %48 = OpFunctionCall %void %textureGather_4e8ac5
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_4e8ac5
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
index 650b75d..20cd25b 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_4e8ac5() {
- var res : vec4<i32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
index 7655962..afea32f 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<f32>
fn textureGather_59372a() {
- var res: vec4<f32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
index c6455a3..dd6f659 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_59372a() {
- vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_59372a() {
- vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp sampler2DArray arg_1_arg_2;
void textureGather_59372a() {
- vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
index 5aaf916..5a520aa 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -48,10 +48,11 @@
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
- %32 = OpConstantNull %v2int
+ %33 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %35 = OpTypeFunction %v4float
+ %36 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_59372a = OpFunction %void None %15
%18 = OpLabel
@@ -61,29 +62,29 @@
%23 = OpSampledImage %22 %21 %20
%26 = OpConvertUToF %float %uint_1
%29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
- %19 = OpImageGather %v4float %23 %29 %uint_1 ConstOffset %32
+ %19 = OpImageGather %v4float %23 %29 %int_1 ConstOffset %33
OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureGather_59372a
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_59372a
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %15
- %40 = OpLabel
- %41 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %41
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %15
- %44 = OpLabel
- %45 = OpFunctionCall %void %textureGather_59372a
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_59372a
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %15
- %47 = OpLabel
- %48 = OpFunctionCall %void %textureGather_59372a
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_59372a
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
index ba0ecac..e558dea 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_59372a() {
- var res : vec4<f32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl
index bec214c..da9987d 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<i32>
fn textureGather_788010() {
- var res: vec4<i32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
index 9f39bc6..e22bd90 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp isamplerCubeArray arg_1_arg_2;
void textureGather_788010() {
- ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp isamplerCubeArray arg_1_arg_2;
void textureGather_788010() {
- ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp isamplerCubeArray arg_1_arg_2;
void textureGather_788010() {
- ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
index 420fdeb..c699707 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 49
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
@@ -49,41 +49,42 @@
%float_0 = OpConstant %float 0
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %33 = OpConstantNull %v4int
- %34 = OpTypeFunction %v4float
+ %34 = OpConstantNull %v4int
+ %35 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_788010 = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %33
+ %res = OpVariable %_ptr_Function_v4int Function %34
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%27 = OpConvertUToF %float %uint_1
%30 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %27
- %20 = OpImageGather %v4int %25 %30 %uint_1
+ %20 = OpImageGather %v4int %25 %30 %int_1
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureGather_788010
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureGather_788010
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %39 = OpLabel
- %40 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %40
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureGather_788010
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureGather_788010
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %46 = OpLabel
- %47 = OpFunctionCall %void %textureGather_788010
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_788010
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
index 1dbb53f..dec67b9 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_788010() {
- var res : vec4<i32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl
index 154c598..be8e1e5 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<f32>
fn textureGather_829357() {
- var res: vec4<f32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
index 083b9ac..32ae841 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp samplerCubeArray arg_1_arg_2;
void textureGather_829357() {
- vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp samplerCubeArray arg_1_arg_2;
void textureGather_829357() {
- vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp samplerCubeArray arg_1_arg_2;
void textureGather_829357() {
- vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
index 0a4125b..ee1c7cc 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 47
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
@@ -47,8 +47,10 @@
%float_0 = OpConstant %float 0
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %31 = OpTypeFunction %v4float
+ %33 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_829357 = OpFunction %void None %15
%18 = OpLabel
@@ -58,29 +60,29 @@
%23 = OpSampledImage %22 %21 %20
%25 = OpConvertUToF %float %uint_1
%28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25
- %19 = OpImageGather %v4float %23 %28 %uint_1
+ %19 = OpImageGather %v4float %23 %28 %int_1
OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureGather_829357
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureGather_829357
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %15
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %15
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureGather_829357
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureGather_829357
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %15
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureGather_829357
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_829357
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
index 475719e..f7c7885 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_829357() {
- var res : vec4<f32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl
new file mode 100644
index 0000000..26bbdfe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<f32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
+fn textureGather_831549() {
+ var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_831549();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_831549();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_831549();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b4df239
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_831549() {
+ float4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_831549();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_831549();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_831549();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b4df239
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_831549() {
+ float4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_831549();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_831549();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_831549();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl
new file mode 100644
index 0000000..49e6ad0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_831549() {
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_831549();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_831549() {
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureGather_831549();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_1_arg_2;
+
+void textureGather_831549() {
+ vec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureGather_831549();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl
new file mode 100644
index 0000000..5f2d880
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_831549(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_831549(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_831549(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm
new file mode 100644
index 0000000..bba13c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_831549 "textureGather_831549"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v2int = OpTypeVector %int 2
+ %33 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_831549 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %14 %arg_2
+ %21 = OpLoad %11 %arg_1
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageGather %v4float %23 %29 %uint_1 ConstOffset %33
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_831549
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_831549
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_831549
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl
new file mode 100644
index 0000000..45ab25d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<f32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_831549() {
+ var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_831549();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_831549();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_831549();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl
new file mode 100644
index 0000000..aa35c72
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<u32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<u32>
+fn textureGather_92ea47() {
+ var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_92ea47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_92ea47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_92ea47();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a5de000
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_92ea47() {
+ uint4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_92ea47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_92ea47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_92ea47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a5de000
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_92ea47() {
+ uint4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_92ea47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_92ea47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_92ea47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl
new file mode 100644
index 0000000..33de790
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_92ea47() {
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_92ea47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_92ea47() {
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_92ea47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_92ea47() {
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_92ea47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl
new file mode 100644
index 0000000..f6c3e37
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_92ea47(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_92ea47(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_92ea47(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_92ea47(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm
new file mode 100644
index 0000000..48e9c34
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_92ea47 "textureGather_92ea47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %24 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %35 = OpConstantNull %v4uint
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_92ea47 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %35
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %28 = OpConvertSToF %float %int_1
+ %31 = OpCompositeConstruct %v3float %float_0 %float_0 %28
+ %20 = OpImageGather %v4uint %25 %31 %uint_1
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_92ea47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_92ea47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_92ea47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl
new file mode 100644
index 0000000..501d2df
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<u32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_92ea47() {
+ var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_92ea47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_92ea47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_92ea47();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl
new file mode 100644
index 0000000..5cc0342
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<i32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<i32>
+fn textureGather_9ab41e() {
+ var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_9ab41e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_9ab41e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_9ab41e();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d13137c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_9ab41e() {
+ int4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_9ab41e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_9ab41e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_9ab41e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d13137c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_9ab41e() {
+ int4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_9ab41e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_9ab41e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_9ab41e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl
new file mode 100644
index 0000000..a6d26d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_9ab41e() {
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_9ab41e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_9ab41e() {
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureGather_9ab41e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_1_arg_2;
+
+void textureGather_9ab41e() {
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureGather_9ab41e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl
new file mode 100644
index 0000000..3af8f5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_9ab41e(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ int4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_9ab41e(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_9ab41e(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_9ab41e(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9af9f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_9ab41e "textureGather_9ab41e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %24 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v2int = OpTypeVector %int 2
+ %34 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %37 = OpConstantNull %v4int
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_9ab41e = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %37
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %28 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %28
+ %20 = OpImageGather %v4int %25 %30 %uint_1 ConstOffset %34
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureGather_9ab41e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_9ab41e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureGather_9ab41e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl
new file mode 100644
index 0000000..71d70bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<i32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_9ab41e() {
+ var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_9ab41e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_9ab41e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_9ab41e();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
index 4eca3a2..16deb12 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<u32>
fn textureGather_a0372b() {
- var res: vec4<u32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
index 4d3163e..5be694b 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_a0372b() {
- uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_a0372b() {
- uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_a0372b() {
- uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
index 67068b3..d90e3ce 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 50
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -48,41 +48,43 @@
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %33 = OpConstantNull %v4uint
- %34 = OpTypeFunction %v4float
+ %35 = OpConstantNull %v4uint
+ %36 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_a0372b = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %33
+ %res = OpVariable %_ptr_Function_v4uint Function %35
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%28 = OpConvertUToF %float %uint_1
%30 = OpCompositeConstruct %v3float %float_0 %float_0 %28
- %20 = OpImageGather %v4uint %25 %30 %uint_1
+ %20 = OpImageGather %v4uint %25 %30 %int_1
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureGather_a0372b
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureGather_a0372b
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %39 = OpLabel
- %40 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %40
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureGather_a0372b
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_a0372b
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %46 = OpLabel
- %47 = OpFunctionCall %void %textureGather_a0372b
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureGather_a0372b
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
index b4702b1..cb4dd68 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_a0372b() {
- var res : vec4<u32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u);
+ var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl
new file mode 100644
index 0000000..a80c3db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_cube_array<i32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<i32>
+fn textureGather_aaf6bd() {
+ var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_aaf6bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_aaf6bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_aaf6bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b7a7ebd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_aaf6bd() {
+ int4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_aaf6bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_aaf6bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_aaf6bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b7a7ebd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<int4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_aaf6bd() {
+ int4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_aaf6bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_aaf6bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_aaf6bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl
new file mode 100644
index 0000000..0ab379a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_1_arg_2;
+
+void textureGather_aaf6bd() {
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_aaf6bd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_1_arg_2;
+
+void textureGather_aaf6bd() {
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_aaf6bd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_1_arg_2;
+
+void textureGather_aaf6bd() {
+ ivec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_aaf6bd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl
new file mode 100644
index 0000000..e738ae2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_aaf6bd(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ int4 res = tint_symbol_1.gather(tint_symbol_2, float3(0.0f), 1, component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_aaf6bd(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_aaf6bd(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_aaf6bd(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm
new file mode 100644
index 0000000..6f938f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_aaf6bd "textureGather_aaf6bd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %24 = OpTypeSampledImage %11
+ %float_0 = OpConstant %float 0
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %34 = OpConstantNull %v4int
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_aaf6bd = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %34
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %27 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %27
+ %20 = OpImageGather %v4int %25 %29 %uint_1
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureGather_aaf6bd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureGather_aaf6bd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_aaf6bd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl
new file mode 100644
index 0000000..6d9a186
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_cube_array<i32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_aaf6bd() {
+ var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_aaf6bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_aaf6bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_aaf6bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
index d2e5f2f..c750140 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<i32>
fn textureGather_bd33b6() {
- var res: vec4<i32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
index 3b5c9e8..54aa26c 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_bd33b6() {
- ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_bd33b6() {
- ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp isampler2DArray arg_1_arg_2;
void textureGather_bd33b6() {
- ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
index f3347b1..7d11614 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -49,43 +49,44 @@
%float_0 = OpConstant %float 0
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
- %33 = OpConstantNull %v2int
+ %34 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %36 = OpConstantNull %v4int
- %37 = OpTypeFunction %v4float
+ %37 = OpConstantNull %v4int
+ %38 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_bd33b6 = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %36
+ %res = OpVariable %_ptr_Function_v4int Function %37
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%28 = OpConvertUToF %float %uint_1
%31 = OpCompositeConstruct %v3float %float_0 %float_0 %28
- %20 = OpImageGather %v4int %25 %31 %uint_1 ConstOffset %33
+ %20 = OpImageGather %v4int %25 %31 %int_1 ConstOffset %34
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureGather_bd33b6
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureGather_bd33b6
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %42 = OpLabel
- %43 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %43
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %46 = OpLabel
- %47 = OpFunctionCall %void %textureGather_bd33b6
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_bd33b6
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %49 = OpLabel
- %50 = OpFunctionCall %void %textureGather_bd33b6
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureGather_bd33b6
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
index 1993fea..2f8357e 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_bd33b6() {
- var res : vec4<i32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
index 2928b32..ac220e7 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<u32>
fn textureGather_be276f() {
- var res: vec4<u32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
index 025d258..58ea7cf 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp usamplerCubeArray arg_1_arg_2;
void textureGather_be276f() {
- uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp usamplerCubeArray arg_1_arg_2;
void textureGather_be276f() {
- uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp usamplerCubeArray arg_1_arg_2;
void textureGather_be276f() {
- uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), int(1u));
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1u)), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
index 22b7575..a9063fa 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 49
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
@@ -48,41 +48,43 @@
%24 = OpTypeSampledImage %11
%float_0 = OpConstant %float 0
%uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %32 = OpConstantNull %v4uint
- %33 = OpTypeFunction %v4float
+ %34 = OpConstantNull %v4uint
+ %35 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_be276f = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %32
+ %res = OpVariable %_ptr_Function_v4uint Function %34
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%27 = OpConvertUToF %float %uint_1
%29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %27
- %20 = OpImageGather %v4uint %25 %29 %uint_1
+ %20 = OpImageGather %v4uint %25 %29 %int_1
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureGather_be276f
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureGather_be276f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %38 = OpLabel
- %39 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %39
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureGather_be276f
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureGather_be276f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %45 = OpLabel
- %46 = OpFunctionCall %void %textureGather_be276f
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_be276f
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
index c14626e..3067707 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_be276f() {
- var res : vec4<u32> = textureGather(1, arg_1, arg_2, vec3<f32>(), 1u);
+ var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(), 1u);
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
index 9ab7bfc..6eea4f2 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
@@ -25,7 +25,7 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<u32>
fn textureGather_ce5578() {
- var res: vec4<u32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
index 001c3b0..9facfd7 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
@@ -3,7 +3,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_ce5578() {
- uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
vec4 vertex_main() {
@@ -25,7 +25,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_ce5578() {
- uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void fragment_main() {
@@ -41,7 +41,7 @@
uniform highp usampler2DArray arg_1_arg_2;
void textureGather_ce5578() {
- uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), int(1u));
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1u)), ivec2(0), 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
index 367be56..92777fb 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -49,43 +49,44 @@
%float_0 = OpConstant %float 0
%uint_1 = OpConstant %uint 1
%int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
- %33 = OpConstantNull %v2int
+ %34 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %36 = OpConstantNull %v4uint
- %37 = OpTypeFunction %v4float
+ %37 = OpConstantNull %v4uint
+ %38 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%textureGather_ce5578 = OpFunction %void None %16
%19 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %36
+ %res = OpVariable %_ptr_Function_v4uint Function %37
%22 = OpLoad %15 %arg_2
%23 = OpLoad %11 %arg_1
%25 = OpSampledImage %24 %23 %22
%28 = OpConvertUToF %float %uint_1
%30 = OpCompositeConstruct %v3float %float_0 %float_0 %28
- %20 = OpImageGather %v4uint %25 %30 %uint_1 ConstOffset %33
+ %20 = OpImageGather %v4uint %25 %30 %int_1 ConstOffset %34
OpStore %res %20
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureGather_ce5578
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureGather_ce5578
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %16
- %42 = OpLabel
- %43 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %43
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %16
- %46 = OpLabel
- %47 = OpFunctionCall %void %textureGather_ce5578
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_ce5578
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %16
- %49 = OpLabel
- %50 = OpFunctionCall %void %textureGather_ce5578
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureGather_ce5578
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
index f07251c..d923193 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
@@ -3,7 +3,7 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_ce5578() {
- var res : vec4<u32> = textureGather(1, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
+ var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(), 1u, vec2<i32>());
}
@vertex
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl
new file mode 100644
index 0000000..418dd84
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_cube_array<u32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<u32>
+fn textureGather_d4b5c6() {
+ var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_d4b5c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_d4b5c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_d4b5c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e433e9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_d4b5c6() {
+ uint4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_d4b5c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_d4b5c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_d4b5c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e433e9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_d4b5c6() {
+ uint4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_d4b5c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_d4b5c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_d4b5c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl
new file mode 100644
index 0000000..09738fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_1_arg_2;
+
+void textureGather_d4b5c6() {
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_d4b5c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_1_arg_2;
+
+void textureGather_d4b5c6() {
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_d4b5c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_1_arg_2;
+
+void textureGather_d4b5c6() {
+ uvec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_d4b5c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl
new file mode 100644
index 0000000..bc0c651
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_d4b5c6(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(0.0f), 1, component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_d4b5c6(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_d4b5c6(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_d4b5c6(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..1a021e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_d4b5c6 "textureGather_d4b5c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %24 = OpTypeSampledImage %11
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %34 = OpConstantNull %v4uint
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_d4b5c6 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %34
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %27 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %27
+ %20 = OpImageGather %v4uint %25 %30 %uint_1
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureGather_d4b5c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureGather_d4b5c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_d4b5c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d58e82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_cube_array<u32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_d4b5c6() {
+ var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_d4b5c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_d4b5c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_d4b5c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl
new file mode 100644
index 0000000..b78c342
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_cube_array<f32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
+fn textureGather_d98d59() {
+ var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_d98d59();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_d98d59();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_d98d59();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..10e683d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_d98d59() {
+ float4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_d98d59();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_d98d59();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_d98d59();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..10e683d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray<float4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_d98d59() {
+ float4 res = arg_1.GatherGreen(arg_2, float4(0.0f, 0.0f, 0.0f, float(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_d98d59();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_d98d59();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_d98d59();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl
new file mode 100644
index 0000000..db13502
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_1_arg_2;
+
+void textureGather_d98d59() {
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_d98d59();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_1_arg_2;
+
+void textureGather_d98d59() {
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void fragment_main() {
+ textureGather_d98d59();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_1_arg_2;
+
+void textureGather_d98d59() {
+ vec4 res = textureGather(arg_1_arg_2, vec4(0.0f, 0.0f, 0.0f, float(1)), int(1u));
+}
+
+void compute_main() {
+ textureGather_d98d59();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl
new file mode 100644
index 0000000..ca2a849
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_d98d59(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float4 res = tint_symbol_1.gather(tint_symbol_2, float3(0.0f), 1, component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_d98d59(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_d98d59(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_d98d59(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm
new file mode 100644
index 0000000..88ac5d0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm
@@ -0,0 +1,88 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 47
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_d98d59 "textureGather_d98d59"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %11
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %33 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_d98d59 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %14 %arg_2
+ %21 = OpLoad %11 %arg_1
+ %23 = OpSampledImage %22 %21 %20
+ %25 = OpConvertSToF %float %int_1
+ %28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25
+ %19 = OpImageGather %v4float %23 %28 %uint_1
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureGather_d98d59
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureGather_d98d59
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureGather_d98d59
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl
new file mode 100644
index 0000000..87129c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_cube_array<f32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_d98d59() {
+ var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_d98d59();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_d98d59();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_d98d59();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl
new file mode 100644
index 0000000..f1fc888
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(1) var arg_1: texture_2d_array<u32>;
+@group(1) @binding(2) var arg_2: sampler;
+
+// fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<u32>
+fn textureGather_e3165f() {
+ var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_e3165f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_e3165f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_e3165f();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e5afb5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_e3165f() {
+ uint4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_e3165f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_e3165f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_e3165f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e5afb5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray<uint4> arg_1 : register(t1, space1);
+SamplerState arg_2 : register(s2, space1);
+
+void textureGather_e3165f() {
+ uint4 res = arg_1.GatherGreen(arg_2, float3(0.0f, 0.0f, float(1)), (0).xx);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureGather_e3165f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureGather_e3165f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureGather_e3165f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl
new file mode 100644
index 0000000..914af11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_e3165f() {
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureGather_e3165f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_e3165f() {
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureGather_e3165f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_1_arg_2;
+
+void textureGather_e3165f() {
+ uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(0.0f, 0.0f, float(1)), ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureGather_e3165f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl
new file mode 100644
index 0000000..12b0c1d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureGather_e3165f(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(0.0f), 1, int2(0), component::y);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureGather_e3165f(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureGather_e3165f(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureGather_e3165f(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm
new file mode 100644
index 0000000..4438901
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %textureGather_e3165f "textureGather_e3165f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ OpDecorate %arg_2 DescriptorSet 1
+ OpDecorate %arg_2 Binding 2
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %15 = OpTypeSampler
+%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
+ %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %24 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+ %v2int = OpTypeVector %int 2
+ %34 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %37 = OpConstantNull %v4uint
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureGather_e3165f = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %37
+ %22 = OpLoad %15 %arg_2
+ %23 = OpLoad %11 %arg_1
+ %25 = OpSampledImage %24 %23 %22
+ %28 = OpConvertSToF %float %int_1
+ %31 = OpCompositeConstruct %v3float %float_0 %float_0 %28
+ %20 = OpImageGather %v4uint %25 %31 %uint_1 ConstOffset %34
+ OpStore %res %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureGather_e3165f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureGather_e3165f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureGather_e3165f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f1dab6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(1) var arg_1 : texture_2d_array<u32>;
+
+@group(1) @binding(2) var arg_2 : sampler;
+
+fn textureGather_e3165f() {
+ var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(), 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureGather_e3165f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureGather_e3165f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureGather_e3165f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl
new file mode 100644
index 0000000..5f879ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureLoad(texture: texture_3d<f32>, coords: vec3<i32>, level: u32) -> vec4<f32>
+fn textureLoad_019da0() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_019da0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_019da0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_019da0();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..170fe3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_019da0() {
+ float4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_019da0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_019da0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_019da0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..170fe3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_019da0() {
+ float4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_019da0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_019da0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_019da0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl
new file mode 100644
index 0000000..faaf797
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_019da0() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_019da0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_019da0() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_019da0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_019da0() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_019da0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl
new file mode 100644
index 0000000..045982a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_019da0(texture3d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint3(int3(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureLoad_019da0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_019da0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_019da0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb8a7d1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_019da0 "textureLoad_019da0"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %20 = OpConstantNull %v3int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_019da0 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_019da0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_019da0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_019da0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl
new file mode 100644
index 0000000..bff3b36
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureLoad_019da0() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_019da0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_019da0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_019da0();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl
new file mode 100644
index 0000000..4a46227
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<u32>
+fn textureLoad_026217() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_026217();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_026217();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_026217();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5deed86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_026217() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_026217();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_026217();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_026217();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5deed86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_026217() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_026217();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_026217();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_026217();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl
new file mode 100644
index 0000000..4647792
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_026217() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_026217();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_026217() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_026217();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_026217() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_026217();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl
new file mode 100644
index 0000000..6b84ada
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_026217(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(uint2(0u)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_026217(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_026217(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_026217(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm
new file mode 100644
index 0000000..8bb3a86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_026217 "textureLoad_026217"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %23 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %28 = OpConstantNull %v4uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_026217 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %28
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %23 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_026217
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_026217
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_026217
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl
new file mode 100644
index 0000000..927fb49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_026217() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_026217();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_026217();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_026217();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl
new file mode 100644
index 0000000..a7ebfdf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: i32, level: u32) -> f32
+fn textureLoad_04b911() {
+ var res: f32 = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_04b911();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_04b911();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_04b911();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5b1cf98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_04b911() {
+ float res = arg_0.Load(uint4(0u, 0u, uint(1), 1u)).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_04b911();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_04b911();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_04b911();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5b1cf98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_04b911() {
+ float res = arg_0.Load(uint4(0u, 0u, uint(1), 1u)).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_04b911();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_04b911();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_04b911();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl
new file mode 100644
index 0000000..045c7b80
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_04b911() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u)).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_04b911();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_04b911() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u)).x;
+}
+
+void fragment_main() {
+ textureLoad_04b911();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_04b911() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u)).x;
+}
+
+void compute_main() {
+ textureLoad_04b911();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl
new file mode 100644
index 0000000..5b8aa49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_04b911(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_04b911(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_04b911(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_04b911(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm
new file mode 100644
index 0000000..29b2cb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_04b911 "textureLoad_04b911"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_04b911 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ %17 = OpImageFetch %v4float %18 %25 Lod %uint_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_04b911
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_04b911
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_04b911
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl
new file mode 100644
index 0000000..f1d96a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_04b911() {
+ var res : f32 = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_04b911();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_04b911();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_04b911();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl
new file mode 100644
index 0000000..2de236d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureLoad(texture: texture_1d<f32>, coords: u32, level: i32) -> vec4<f32>
+fn textureLoad_1373dc() {
+ var res: vec4<f32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1373dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1373dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1373dc();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..30cef21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_1373dc() {
+ float4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1373dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1373dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1373dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..30cef21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_1373dc() {
+ float4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1373dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1373dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1373dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl
new file mode 100644
index 0000000..4952ed3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_1373dc() {
+ vec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_1373dc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_1373dc() {
+ vec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void fragment_main() {
+ textureLoad_1373dc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_1373dc() {
+ vec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void compute_main() {
+ textureLoad_1373dc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl
new file mode 100644
index 0000000..683b90c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1373dc(texture1d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint(1u), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureLoad_1373dc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_1373dc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_1373dc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm
new file mode 100644
index 0000000..c7efb23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1373dc "textureLoad_1373dc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1373dc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %uint_1 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_1373dc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_1373dc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_1373dc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl
new file mode 100644
index 0000000..c304750
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureLoad_1373dc() {
+ var res : vec4<f32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1373dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1373dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1373dc();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl
new file mode 100644
index 0000000..56e1e07
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<i32>
+fn textureLoad_168dc8() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_168dc8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_168dc8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_168dc8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..78a1282
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_168dc8() {
+ int4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_168dc8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_168dc8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_168dc8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..78a1282
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_168dc8() {
+ int4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_168dc8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_168dc8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_168dc8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl
new file mode 100644
index 0000000..208d0ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_168dc8() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_168dc8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_168dc8() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void fragment_main() {
+ textureLoad_168dc8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_168dc8() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void compute_main() {
+ textureLoad_168dc8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl
new file mode 100644
index 0000000..407397f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_168dc8(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_168dc8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_168dc8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_168dc8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm
new file mode 100644
index 0000000..635d95a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_168dc8 "textureLoad_168dc8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %28 = OpConstantNull %v4int
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_168dc8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %28
+ %19 = OpLoad %11 %arg_0
+ %23 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %23
+ %17 = OpImageFetch %v4int %19 %25 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_168dc8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_168dc8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_168dc8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl
new file mode 100644
index 0000000..4a87cc4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_168dc8() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_168dc8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_168dc8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_168dc8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl
new file mode 100644
index 0000000..f137b59
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<u32>
+fn textureLoad_1b051f() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1b051f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1b051f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1b051f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..52b2377
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_1b051f() {
+ uint4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1b051f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1b051f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1b051f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..52b2377
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_1b051f() {
+ uint4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1b051f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1b051f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1b051f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl
new file mode 100644
index 0000000..99a31bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_1b051f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_1b051f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_1b051f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_1b051f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_1b051f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void compute_main() {
+ textureLoad_1b051f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl
new file mode 100644
index 0000000..77655f2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1b051f(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_1b051f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_1b051f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_1b051f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm
new file mode 100644
index 0000000..952a0fb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1b051f "textureLoad_1b051f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %28 = OpConstantNull %v4uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1b051f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %28
+ %19 = OpLoad %11 %arg_0
+ %23 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %23
+ %17 = OpImageFetch %v4uint %19 %25 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_1b051f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_1b051f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_1b051f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl
new file mode 100644
index 0000000..99f3b15
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_1b051f() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1b051f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1b051f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1b051f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
index 76c37ef..a4dd107 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
@@ -33,9 +33,9 @@
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = plane0.Load(uint3(coord, 0u)).rgb;
+ color = plane0.Load(uint3(coord, uint(0))).rgb;
} else {
- color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(uint3(coord, 0u)).r, plane1.Load(uint3(coord, 0u)).rg, 1.0f));
+ color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(uint3(coord, uint(0))).r, plane1.Load(uint3(coord, uint(0))).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
index 76c37ef..a4dd107 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
@@ -33,9 +33,9 @@
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
float3 color = float3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = plane0.Load(uint3(coord, 0u)).rgb;
+ color = plane0.Load(uint3(coord, uint(0))).rgb;
} else {
- color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(uint3(coord, 0u)).r, plane1.Load(uint3(coord, 0u)).rg, 1.0f));
+ color = mul(params.yuvToRgbConversionMatrix, float4(plane0.Load(uint3(coord, uint(0))).r, plane1.Load(uint3(coord, uint(0))).rg, 1.0f));
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
index 214f868..e65e748 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -34,9 +34,9 @@
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = texelFetch(plane0_1, ivec2(coord), int(0u)).rgb;
+ color = texelFetch(plane0_1, ivec2(coord), 0).rgb;
} else {
- color = (vec4(texelFetch(plane0_1, ivec2(coord), int(0u)).r, texelFetch(plane1_1, ivec2(coord), int(0u)).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (vec4(texelFetch(plane0_1, ivec2(coord), 0).r, texelFetch(plane1_1, ivec2(coord), 0).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -102,9 +102,9 @@
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = texelFetch(plane0_1, ivec2(coord), int(0u)).rgb;
+ color = texelFetch(plane0_1, ivec2(coord), 0).rgb;
} else {
- color = (vec4(texelFetch(plane0_1, ivec2(coord), int(0u)).r, texelFetch(plane1_1, ivec2(coord), int(0u)).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (vec4(texelFetch(plane0_1, ivec2(coord), 0).r, texelFetch(plane1_1, ivec2(coord), 0).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
@@ -164,9 +164,9 @@
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
vec3 color = vec3(0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
- color = texelFetch(plane0_1, ivec2(coord), int(0u)).rgb;
+ color = texelFetch(plane0_1, ivec2(coord), 0).rgb;
} else {
- color = (vec4(texelFetch(plane0_1, ivec2(coord), int(0u)).r, texelFetch(plane1_1, ivec2(coord), int(0u)).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (vec4(texelFetch(plane0_1, ivec2(coord), 0).r, texelFetch(plane1_1, ivec2(coord), 0).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
index 81c3daa..e5b7c01 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
@@ -45,9 +45,9 @@
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, uint2 coord, ExternalTextureParams params) {
float3 color = 0.0f;
if ((params.numPlanes == 1u)) {
- color = float4(plane0.read(uint2(coord), 0u)).rgb;
+ color = float4(plane0.read(uint2(coord), 0)).rgb;
} else {
- color = (float4(plane0.read(uint2(coord), 0u)[0], float4(plane1.read(uint2(coord), 0u)).rg, 1.0f) * params.yuvToRgbConversionMatrix);
+ color = (float4(plane0.read(uint2(coord), 0)[0], float4(plane1.read(uint2(coord), 0)).rg, 1.0f) * params.yuvToRgbConversionMatrix);
}
if ((params.doYuvToRgbConversionOnly == 0u)) {
color = gammaCorrection(color, params.gammaDecodeParams);
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
index 60ee453..4ac1277 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 136
+; Bound: 138
; Schema: 0
OpCapability Shader
%28 = OpExtInstImport "GLSL.std.450"
@@ -107,16 +107,18 @@
%v2uint = OpTypeVector %uint 2
%62 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
%uint_1 = OpConstant %uint 1
- %78 = OpConstantNull %uint
+ %int = OpTypeInt 32 1
+ %79 = OpConstantNull %int
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1
+ %93 = OpConstantNull %uint
%void = OpTypeVoid
- %109 = OpTypeFunction %void
- %116 = OpConstantNull %v2uint
+ %111 = OpTypeFunction %void
+ %118 = OpConstantNull %v2uint
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %123 = OpTypeFunction %v4float
+ %125 = OpTypeFunction %v4float
%gammaCorrection = OpFunction %v3float None %22
%v = OpFunctionParameter %v3float
%params = OpFunctionParameter %GammaTransferParams
@@ -165,79 +167,79 @@
OpSelectionMerge %74 None
OpBranchConditional %73 %75 %76
%75 = OpLabel
- %77 = OpImageFetch %v4float %plane0 %coord Lod %78
- %79 = OpVectorShuffle %v3float %77 %77 0 1 2
- OpStore %color %79
+ %77 = OpImageFetch %v4float %plane0 %coord Lod %79
+ %80 = OpVectorShuffle %v3float %77 %77 0 1 2
+ OpStore %color %80
OpBranch %74
%76 = OpLabel
- %80 = OpImageFetch %v4float %plane0 %coord Lod %78
- %81 = OpCompositeExtract %float %80 0
- %82 = OpImageFetch %v4float %plane1 %coord Lod %78
- %84 = OpVectorShuffle %v2float %82 %82 0 1
- %85 = OpCompositeExtract %float %84 0
- %86 = OpCompositeExtract %float %84 1
- %88 = OpCompositeConstruct %v4float %81 %85 %86 %float_1
- %89 = OpCompositeExtract %mat3v4float %params_0 2
- %90 = OpVectorTimesMatrix %v3float %88 %89
- OpStore %color %90
+ %81 = OpImageFetch %v4float %plane0 %coord Lod %79
+ %82 = OpCompositeExtract %float %81 0
+ %83 = OpImageFetch %v4float %plane1 %coord Lod %79
+ %85 = OpVectorShuffle %v2float %83 %83 0 1
+ %86 = OpCompositeExtract %float %85 0
+ %87 = OpCompositeExtract %float %85 1
+ %89 = OpCompositeConstruct %v4float %82 %86 %87 %float_1
+ %90 = OpCompositeExtract %mat3v4float %params_0 2
+ %91 = OpVectorTimesMatrix %v3float %89 %90
+ OpStore %color %91
OpBranch %74
%74 = OpLabel
- %91 = OpCompositeExtract %uint %params_0 1
- %92 = OpIEqual %bool %91 %78
- OpSelectionMerge %93 None
- OpBranchConditional %92 %94 %93
- %94 = OpLabel
- %96 = OpLoad %v3float %color
- %97 = OpCompositeExtract %GammaTransferParams %params_0 3
- %95 = OpFunctionCall %v3float %gammaCorrection %96 %97
- OpStore %color %95
- %98 = OpCompositeExtract %mat3v3float %params_0 5
- %99 = OpLoad %v3float %color
- %100 = OpMatrixTimesVector %v3float %98 %99
- OpStore %color %100
- %102 = OpLoad %v3float %color
- %103 = OpCompositeExtract %GammaTransferParams %params_0 4
- %101 = OpFunctionCall %v3float %gammaCorrection %102 %103
- OpStore %color %101
- OpBranch %93
- %93 = OpLabel
+ %92 = OpCompositeExtract %uint %params_0 1
+ %94 = OpIEqual %bool %92 %93
+ OpSelectionMerge %95 None
+ OpBranchConditional %94 %96 %95
+ %96 = OpLabel
+ %98 = OpLoad %v3float %color
+ %99 = OpCompositeExtract %GammaTransferParams %params_0 3
+ %97 = OpFunctionCall %v3float %gammaCorrection %98 %99
+ OpStore %color %97
+ %100 = OpCompositeExtract %mat3v3float %params_0 5
+ %101 = OpLoad %v3float %color
+ %102 = OpMatrixTimesVector %v3float %100 %101
+ OpStore %color %102
%104 = OpLoad %v3float %color
- %105 = OpCompositeExtract %float %104 0
- %106 = OpCompositeExtract %float %104 1
- %107 = OpCompositeExtract %float %104 2
- %108 = OpCompositeConstruct %v4float %105 %106 %107 %float_1
- OpReturnValue %108
+ %105 = OpCompositeExtract %GammaTransferParams %params_0 4
+ %103 = OpFunctionCall %v3float %gammaCorrection %104 %105
+ OpStore %color %103
+ OpBranch %95
+ %95 = OpLabel
+ %106 = OpLoad %v3float %color
+ %107 = OpCompositeExtract %float %106 0
+ %108 = OpCompositeExtract %float %106 1
+ %109 = OpCompositeExtract %float %106 2
+ %110 = OpCompositeConstruct %v4float %107 %108 %109 %float_1
+ OpReturnValue %110
OpFunctionEnd
-%textureLoad_1bfdfb = OpFunction %void None %109
- %112 = OpLabel
+%textureLoad_1bfdfb = OpFunction %void None %111
+ %114 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
- %114 = OpLoad %11 %arg_0
- %115 = OpLoad %11 %ext_tex_plane_1
- %119 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0
- %120 = OpLoad %ExternalTextureParams %119
- %113 = OpFunctionCall %v4float %textureLoadExternal %114 %115 %116 %120
- OpStore %res %113
+ %116 = OpLoad %11 %arg_0
+ %117 = OpLoad %11 %ext_tex_plane_1
+ %121 = OpAccessChain %_ptr_Uniform_ExternalTextureParams %ext_tex_params %uint_0
+ %122 = OpLoad %ExternalTextureParams %121
+ %115 = OpFunctionCall %v4float %textureLoadExternal %116 %117 %118 %122
+ OpStore %res %115
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %123
- %125 = OpLabel
- %126 = OpFunctionCall %void %textureLoad_1bfdfb
+%vertex_main_inner = OpFunction %v4float None %125
+ %127 = OpLabel
+ %128 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturnValue %5
OpFunctionEnd
-%vertex_main = OpFunction %void None %109
- %128 = OpLabel
- %129 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %129
+%vertex_main = OpFunction %void None %111
+ %130 = OpLabel
+ %131 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %131
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %109
- %131 = OpLabel
- %132 = OpFunctionCall %void %textureLoad_1bfdfb
+%fragment_main = OpFunction %void None %111
+ %133 = OpLabel
+ %134 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %109
- %134 = OpLabel
- %135 = OpFunctionCall %void %textureLoad_1bfdfb
+%compute_main = OpFunction %void None %111
+ %136 = OpLabel
+ %137 = OpFunctionCall %void %textureLoad_1bfdfb
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl
new file mode 100644
index 0000000..e03b36b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureLoad(texture: texture_1d<u32>, coords: u32, level: i32) -> vec4<u32>
+fn textureLoad_216c37() {
+ var res: vec4<u32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_216c37();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_216c37();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_216c37();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4b154a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_216c37() {
+ uint4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_216c37();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_216c37();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_216c37();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4b154a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_216c37() {
+ uint4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_216c37();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_216c37();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_216c37();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl
new file mode 100644
index 0000000..9bda9d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_216c37() {
+ uvec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_216c37();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_216c37() {
+ uvec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void fragment_main() {
+ textureLoad_216c37();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_216c37() {
+ uvec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void compute_main() {
+ textureLoad_216c37();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl
new file mode 100644
index 0000000..96fe68d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_216c37(texture1d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint(1u), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureLoad_216c37(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_216c37(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_216c37(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm
new file mode 100644
index 0000000..d323ef0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_216c37 "textureLoad_216c37"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_216c37 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %uint_1 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_216c37
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_216c37
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_216c37
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl
new file mode 100644
index 0000000..812abaa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureLoad_216c37() {
+ var res : vec4<u32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_216c37();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_216c37();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_216c37();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl
new file mode 100644
index 0000000..c31e51d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureLoad(texture: texture_3d<i32>, coords: vec3<u32>, level: i32) -> vec4<i32>
+fn textureLoad_223246() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_223246();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_223246();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_223246();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c434c8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_223246() {
+ int4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_223246();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_223246();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_223246();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c434c8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_223246() {
+ int4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_223246();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_223246();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_223246();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl
new file mode 100644
index 0000000..39f77c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_223246() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_223246();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_223246() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_223246();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_223246() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_223246();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl
new file mode 100644
index 0000000..3372521
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_223246(texture3d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint3(uint3(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureLoad_223246(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_223246(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_223246(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm
new file mode 100644
index 0000000..bba82c9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_223246 "textureLoad_223246"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %22 = OpConstantNull %v3uint
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_223246 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %22 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_223246
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_223246
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_223246
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl
new file mode 100644
index 0000000..1a14589
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureLoad_223246() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_223246();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_223246();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_223246();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl
new file mode 100644
index 0000000..4d77af6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<i32>
+fn textureLoad_2363be() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_2363be();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_2363be();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_2363be();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1fcee1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_2363be() {
+ int4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_2363be();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_2363be();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2363be();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1fcee1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_2363be() {
+ int4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_2363be();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_2363be();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2363be();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl
new file mode 100644
index 0000000..1854c65
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_2363be() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_2363be();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_2363be() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_2363be();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_2363be() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void compute_main() {
+ textureLoad_2363be();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl
new file mode 100644
index 0000000..2281819
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_2363be(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_2363be(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_2363be(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_2363be(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm
new file mode 100644
index 0000000..35dce1e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_2363be "textureLoad_2363be"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %29 = OpConstantNull %v4int
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_2363be = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %29
+ %19 = OpLoad %11 %arg_0
+ %23 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %23
+ %17 = OpImageFetch %v4int %19 %25 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_2363be
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_2363be
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_2363be
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl
new file mode 100644
index 0000000..295dadc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_2363be() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_2363be();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_2363be();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_2363be();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl
new file mode 100644
index 0000000..102ca0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureLoad(texture: texture_2d<f32>, coords: vec2<i32>, level: u32) -> vec4<f32>
+fn textureLoad_2d479c() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_2d479c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_2d479c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_2d479c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..48743d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_2d479c() {
+ float4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_2d479c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_2d479c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2d479c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..48743d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_2d479c() {
+ float4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_2d479c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_2d479c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2d479c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl
new file mode 100644
index 0000000..480acb7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_2d479c() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_2d479c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_2d479c() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_2d479c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_2d479c() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_2d479c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl
new file mode 100644
index 0000000..64a9fa9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_2d479c(texture2d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureLoad_2d479c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_2d479c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_2d479c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea0f240
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_2d479c "textureLoad_2d479c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %20 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_2d479c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_2d479c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_2d479c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_2d479c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl
new file mode 100644
index 0000000..93532d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureLoad_2d479c() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_2d479c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_2d479c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_2d479c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl
new file mode 100644
index 0000000..1ba95c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<i32>, sample_index: u32) -> vec4<i32>
+fn textureLoad_38f8ab() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_38f8ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_38f8ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_38f8ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b32e2f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureLoad_38f8ab() {
+ int4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_38f8ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_38f8ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_38f8ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b32e2f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureLoad_38f8ab() {
+ int4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_38f8ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_38f8ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_38f8ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl
new file mode 100644
index 0000000..199f0a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_38f8ab() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_38f8ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_38f8ab() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_38f8ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_38f8ab() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_38f8ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl
new file mode 100644
index 0000000..062a78c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_38f8ab(texture2d_ms<int, access::read> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureLoad_38f8ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_38f8ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_38f8ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..5bcd7ad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_38f8ab "textureLoad_38f8ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %21 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_38f8ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Sample %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_38f8ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_38f8ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_38f8ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..0a81a11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureLoad_38f8ab() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_38f8ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_38f8ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_38f8ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl
new file mode 100644
index 0000000..f3db7a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<f32>
+fn textureLoad_3c96e8() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3c96e8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3c96e8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3c96e8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1b18d6f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3c96e8() {
+ float4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3c96e8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3c96e8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3c96e8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1b18d6f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3c96e8() {
+ float4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3c96e8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3c96e8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3c96e8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl
new file mode 100644
index 0000000..712a973
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_3c96e8() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_3c96e8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_3c96e8() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_3c96e8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_3c96e8() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void compute_main() {
+ textureLoad_3c96e8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl
new file mode 100644
index 0000000..468cb47
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3c96e8(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_3c96e8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_3c96e8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_3c96e8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm
new file mode 100644
index 0000000..4aaf7c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3c96e8 "textureLoad_3c96e8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3c96e8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ %16 = OpImageFetch %v4float %17 %24 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_3c96e8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_3c96e8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_3c96e8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl
new file mode 100644
index 0000000..487fe60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_3c96e8() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3c96e8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3c96e8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3c96e8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl
new file mode 100644
index 0000000..a7f50c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<i32>
+fn textureLoad_3d3fd1() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3d3fd1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3d3fd1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3d3fd1();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f31c316
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_3d3fd1() {
+ int4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3d3fd1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3d3fd1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3d3fd1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f31c316
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_3d3fd1() {
+ int4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3d3fd1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3d3fd1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3d3fd1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl
new file mode 100644
index 0000000..9d295c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_3d3fd1() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_3d3fd1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_3d3fd1() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_3d3fd1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_3d3fd1() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_3d3fd1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl
new file mode 100644
index 0000000..63fddeb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3d3fd1(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(uint2(0u)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_3d3fd1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_3d3fd1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_3d3fd1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm
new file mode 100644
index 0000000..73e3401
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3d3fd1 "textureLoad_3d3fd1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %24 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %28 = OpConstantNull %v4int
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3d3fd1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %28
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %24 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_3d3fd1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_3d3fd1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_3d3fd1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl
new file mode 100644
index 0000000..a053554
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_3d3fd1() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3d3fd1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3d3fd1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3d3fd1();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl
new file mode 100644
index 0000000..81954b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureLoad(texture: texture_1d<f32>, coords: i32, level: u32) -> vec4<f32>
+fn textureLoad_3da3ed() {
+ var res: vec4<f32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3da3ed();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3da3ed();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3da3ed();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ae51c8e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3da3ed() {
+ float4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3da3ed();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3da3ed();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3da3ed();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ae51c8e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3da3ed() {
+ float4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3da3ed();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3da3ed();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3da3ed();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl
new file mode 100644
index 0000000..7d7008a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_3da3ed() {
+ vec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_3da3ed();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_3da3ed() {
+ vec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void fragment_main() {
+ textureLoad_3da3ed();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureLoad_3da3ed() {
+ vec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void compute_main() {
+ textureLoad_3da3ed();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl
new file mode 100644
index 0000000..84e357d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3da3ed(texture1d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint(1), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureLoad_3da3ed(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_3da3ed(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_3da3ed(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm
new file mode 100644
index 0000000..45bef6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3da3ed "textureLoad_3da3ed"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3da3ed = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %int_1 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_3da3ed
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_3da3ed
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_3da3ed
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl
new file mode 100644
index 0000000..e832060
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureLoad_3da3ed() {
+ var res : vec4<f32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3da3ed();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3da3ed();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3da3ed();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl
new file mode 100644
index 0000000..d677077
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureLoad(texture: texture_2d<f32>, coords: vec2<u32>, level: i32) -> vec4<f32>
+fn textureLoad_439e2a() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_439e2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_439e2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_439e2a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..04be847
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_439e2a() {
+ float4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_439e2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_439e2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_439e2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..04be847
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_439e2a() {
+ float4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_439e2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_439e2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_439e2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl
new file mode 100644
index 0000000..3e1a9c9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_439e2a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_439e2a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_439e2a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_439e2a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_439e2a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_439e2a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl
new file mode 100644
index 0000000..9a44d70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_439e2a(texture2d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureLoad_439e2a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_439e2a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_439e2a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..bd14760
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_439e2a "textureLoad_439e2a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %20 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_439e2a = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_439e2a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_439e2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_439e2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..0cc7d74
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureLoad_439e2a() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_439e2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_439e2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_439e2a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl
new file mode 100644
index 0000000..eb46b20
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<f32>
+fn textureLoad_46a93f() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_46a93f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_46a93f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_46a93f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..efe3b08
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_46a93f() {
+ float4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_46a93f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_46a93f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_46a93f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..efe3b08
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_46a93f() {
+ float4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_46a93f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_46a93f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_46a93f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl
new file mode 100644
index 0000000..ba12442
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_46a93f() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_46a93f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_46a93f() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_46a93f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_46a93f() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void compute_main() {
+ textureLoad_46a93f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl
new file mode 100644
index 0000000..06c32ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_46a93f(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_46a93f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_46a93f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_46a93f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm
new file mode 100644
index 0000000..a294467
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_46a93f "textureLoad_46a93f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_46a93f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ %16 = OpImageFetch %v4float %17 %24 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_46a93f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_46a93f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_46a93f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5a4417
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_46a93f() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_46a93f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_46a93f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_46a93f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl
new file mode 100644
index 0000000..82d2b57
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<f32>
+fn textureLoad_4acb64() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4acb64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4acb64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4acb64();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..21f231b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_4acb64() {
+ float4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4acb64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4acb64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4acb64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..21f231b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_4acb64() {
+ float4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4acb64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4acb64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4acb64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl
new file mode 100644
index 0000000..0490887
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_4acb64() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_4acb64();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_4acb64() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_4acb64();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_4acb64() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_4acb64();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl
new file mode 100644
index 0000000..247c9fc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_4acb64(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_4acb64(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_4acb64(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_4acb64(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm
new file mode 100644
index 0000000..1fcd8ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_4acb64 "textureLoad_4acb64"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_4acb64 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ %16 = OpImageFetch %v4float %17 %24 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_4acb64
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_4acb64
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_4acb64
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl
new file mode 100644
index 0000000..f55bd6b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_4acb64() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4acb64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4acb64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4acb64();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl
new file mode 100644
index 0000000..fad9797
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureLoad(texture: texture_1d<i32>, coords: u32, level: i32) -> vec4<i32>
+fn textureLoad_4c423f() {
+ var res: vec4<i32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4c423f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4c423f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4c423f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8e65740
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_4c423f() {
+ int4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4c423f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4c423f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4c423f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8e65740
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_4c423f() {
+ int4 res = arg_0.Load(uint2(1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4c423f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4c423f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4c423f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl
new file mode 100644
index 0000000..a030cac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_4c423f() {
+ ivec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_4c423f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_4c423f() {
+ ivec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void fragment_main() {
+ textureLoad_4c423f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_4c423f() {
+ ivec4 res = texelFetch(arg_0_1, int(1u), 1);
+}
+
+void compute_main() {
+ textureLoad_4c423f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl
new file mode 100644
index 0000000..d02ad77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_4c423f(texture1d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint(1u), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureLoad_4c423f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_4c423f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_4c423f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm
new file mode 100644
index 0000000..b119edc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_4c423f "textureLoad_4c423f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %25 = OpConstantNull %v4int
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_4c423f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %25
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %uint_1 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_4c423f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_4c423f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_4c423f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl
new file mode 100644
index 0000000..08cd408
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureLoad_4c423f() {
+ var res : vec4<i32> = textureLoad(arg_0, 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4c423f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4c423f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4c423f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl
new file mode 100644
index 0000000..86eb297
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<u32>
+fn textureLoad_53e142() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_53e142();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_53e142();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_53e142();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7485817
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_53e142() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_53e142();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_53e142();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_53e142();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7485817
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_53e142() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_53e142();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_53e142();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_53e142();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl
new file mode 100644
index 0000000..60635a4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_53e142() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_53e142();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_53e142() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void fragment_main() {
+ textureLoad_53e142();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_53e142() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void compute_main() {
+ textureLoad_53e142();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl
new file mode 100644
index 0000000..b7c7b22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_53e142(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_53e142(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_53e142(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_53e142(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm
new file mode 100644
index 0000000..47244e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_53e142 "textureLoad_53e142"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %28 = OpConstantNull %v4uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_53e142 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %28
+ %19 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ %17 = OpImageFetch %v4uint %19 %25 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_53e142
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_53e142
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_53e142
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl
new file mode 100644
index 0000000..741a7f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_53e142() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_53e142();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_53e142();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_53e142();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl
new file mode 100644
index 0000000..0cd6406
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<f32>
+fn textureLoad_54a59b() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_54a59b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_54a59b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_54a59b();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..37fc597
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_54a59b() {
+ float4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_54a59b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_54a59b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_54a59b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..37fc597
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_54a59b() {
+ float4 res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_54a59b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_54a59b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_54a59b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl
new file mode 100644
index 0000000..1cbdc29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_54a59b() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_54a59b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_54a59b() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void fragment_main() {
+ textureLoad_54a59b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_54a59b() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1);
+}
+
+void compute_main() {
+ textureLoad_54a59b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl
new file mode 100644
index 0000000..05527a5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_54a59b(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_54a59b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_54a59b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_54a59b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm
new file mode 100644
index 0000000..14f2601
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_54a59b "textureLoad_54a59b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_54a59b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ %16 = OpImageFetch %v4float %17 %24 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_54a59b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_54a59b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_54a59b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl
new file mode 100644
index 0000000..bf69b5d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_54a59b() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_54a59b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_54a59b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_54a59b();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl
new file mode 100644
index 0000000..b23027c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureLoad(texture: texture_1d<i32>, coords: i32, level: u32) -> vec4<i32>
+fn textureLoad_62d1de() {
+ var res: vec4<i32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_62d1de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_62d1de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_62d1de();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..51ff9e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_62d1de() {
+ int4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_62d1de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_62d1de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_62d1de();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..51ff9e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_62d1de() {
+ int4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_62d1de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_62d1de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_62d1de();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl
new file mode 100644
index 0000000..55bcb8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_62d1de() {
+ ivec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_62d1de();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_62d1de() {
+ ivec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void fragment_main() {
+ textureLoad_62d1de();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureLoad_62d1de() {
+ ivec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void compute_main() {
+ textureLoad_62d1de();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl
new file mode 100644
index 0000000..1f95d13
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_62d1de(texture1d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint(1), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureLoad_62d1de(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_62d1de(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_62d1de(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm
new file mode 100644
index 0000000..0e3b453
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_62d1de "textureLoad_62d1de"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %25 = OpConstantNull %v4int
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_62d1de = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %25
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %int_1 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_62d1de
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_62d1de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_62d1de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl
new file mode 100644
index 0000000..d456895
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureLoad_62d1de() {
+ var res : vec4<i32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_62d1de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_62d1de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_62d1de();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl
new file mode 100644
index 0000000..11c7cb5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<u32>
+fn textureLoad_656d76() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_656d76();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_656d76();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_656d76();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bf91da0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_656d76() {
+ uint4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_656d76();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_656d76();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_656d76();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bf91da0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_656d76() {
+ uint4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_656d76();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_656d76();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_656d76();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl
new file mode 100644
index 0000000..3aad010
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_656d76() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_656d76();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_656d76() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_656d76();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_656d76() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void compute_main() {
+ textureLoad_656d76();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl
new file mode 100644
index 0000000..a992774
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_656d76(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(int2(0)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_656d76(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_656d76(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_656d76(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b2bd2b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_656d76 "textureLoad_656d76"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %28 = OpConstantNull %v4uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_656d76 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %28
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %24 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_656d76
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_656d76
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_656d76
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7a3ebd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_656d76() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_656d76();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_656d76();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_656d76();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl
new file mode 100644
index 0000000..7014871
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: u32, level: u32) -> f32
+fn textureLoad_66be47() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_66be47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_66be47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_66be47();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..73885a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_66be47() {
+ float res = arg_0.Load(int4(0, 0, int(1u), int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_66be47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_66be47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_66be47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..73885a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_66be47() {
+ float res = arg_0.Load(int4(0, 0, int(1u), int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_66be47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_66be47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_66be47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl
new file mode 100644
index 0000000..f8185c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_66be47() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u)).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_66be47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_66be47() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u)).x;
+}
+
+void fragment_main() {
+ textureLoad_66be47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_66be47() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u)).x;
+}
+
+void compute_main() {
+ textureLoad_66be47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl
new file mode 100644
index 0000000..17fef2f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_66be47(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(int2(0)), 1u, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_66be47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_66be47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_66be47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm
new file mode 100644
index 0000000..990ebb0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_66be47 "textureLoad_66be47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_66be47 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ %17 = OpImageFetch %v4float %18 %25 Lod %uint_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_66be47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_66be47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_66be47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl
new file mode 100644
index 0000000..1832e29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_66be47() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_66be47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_66be47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_66be47();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl
new file mode 100644
index 0000000..2b8177e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<i32>, sample_index: u32) -> f32
+fn textureLoad_6925bc() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6925bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6925bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6925bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ccd6a22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_6925bc() {
+ float res = arg_0.Load(int3(0, 0, 0), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6925bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6925bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6925bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ccd6a22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_6925bc() {
+ float res = arg_0.Load(int3(0, 0, 0), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6925bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6925bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6925bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl
new file mode 100644
index 0000000..76b2acd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_6925bc() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_6925bc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_6925bc() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+void fragment_main() {
+ textureLoad_6925bc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_6925bc() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+void compute_main() {
+ textureLoad_6925bc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl
new file mode 100644
index 0000000..97acbd3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6925bc(depth2d_ms<float, access::read> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureLoad_6925bc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_6925bc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_6925bc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..cda1ac2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_6925bc "textureLoad_6925bc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %21 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_6925bc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %21 Sample %uint_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_6925bc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_6925bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_6925bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..14dd184
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureLoad_6925bc() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6925bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6925bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6925bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl
new file mode 100644
index 0000000..26bd09c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureLoad(texture: texture_1d<u32>, coords: i32, level: u32) -> vec4<u32>
+fn textureLoad_6b77d4() {
+ var res: vec4<u32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6b77d4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6b77d4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6b77d4();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ca9686
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_6b77d4() {
+ uint4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6b77d4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6b77d4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6b77d4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ca9686
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_6b77d4() {
+ uint4 res = arg_0.Load(int2(1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6b77d4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6b77d4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6b77d4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl
new file mode 100644
index 0000000..4fbc6f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_6b77d4() {
+ uvec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_6b77d4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_6b77d4() {
+ uvec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void fragment_main() {
+ textureLoad_6b77d4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureLoad_6b77d4() {
+ uvec4 res = texelFetch(arg_0_1, 1, int(1u));
+}
+
+void compute_main() {
+ textureLoad_6b77d4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl
new file mode 100644
index 0000000..7669ab8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6b77d4(texture1d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint(1), 0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureLoad_6b77d4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_6b77d4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_6b77d4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm
new file mode 100644
index 0000000..1f1b990
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_6b77d4 "textureLoad_6b77d4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_6b77d4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %int_1 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_6b77d4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_6b77d4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_6b77d4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl
new file mode 100644
index 0000000..11e4711
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureLoad_6b77d4() {
+ var res : vec4<u32> = textureLoad(arg_0, 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6b77d4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6b77d4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6b77d4();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl
new file mode 100644
index 0000000..3ef2937
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureLoad(texture: texture_3d<u32>, coords: vec3<i32>, level: u32) -> vec4<u32>
+fn textureLoad_6bf4b7() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6bf4b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6bf4b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6bf4b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8012b52
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_6bf4b7() {
+ uint4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6bf4b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6bf4b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6bf4b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8012b52
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_6bf4b7() {
+ uint4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6bf4b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6bf4b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6bf4b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl
new file mode 100644
index 0000000..87a337c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_6bf4b7() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_6bf4b7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_6bf4b7() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_6bf4b7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_6bf4b7() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_6bf4b7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl
new file mode 100644
index 0000000..0fa3b97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6bf4b7(texture3d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint3(int3(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureLoad_6bf4b7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_6bf4b7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_6bf4b7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm
new file mode 100644
index 0000000..74c96d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_6bf4b7 "textureLoad_6bf4b7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %22 = OpConstantNull %v3int
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_6bf4b7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_6bf4b7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_6bf4b7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_6bf4b7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl
new file mode 100644
index 0000000..87ee760
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureLoad_6bf4b7() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6bf4b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6bf4b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6bf4b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl
new file mode 100644
index 0000000..dcfb039
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<f32>
+fn textureLoad_789045() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_789045();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_789045();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_789045();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7c7ed8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_789045() {
+ float4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_789045();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_789045();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_789045();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7c7ed8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_789045() {
+ float4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_789045();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_789045();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_789045();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl
new file mode 100644
index 0000000..9e596c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_789045() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_789045();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_789045() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_789045();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_789045() {
+ vec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void compute_main() {
+ textureLoad_789045();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl
new file mode 100644
index 0000000..903adf9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_789045(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(int2(0)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_789045(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_789045(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_789045(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm
new file mode 100644
index 0000000..7398fc6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_789045 "textureLoad_789045"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_789045 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %22 Lod %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_789045
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_789045
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_789045
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl
new file mode 100644
index 0000000..10a00a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_789045() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_789045();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_789045();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_789045();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl
new file mode 100644
index 0000000..efd577e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<u32>
+fn textureLoad_7ab4df() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7ab4df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7ab4df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7ab4df();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b6d28d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_7ab4df() {
+ uint4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7ab4df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7ab4df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7ab4df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b6d28d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_7ab4df() {
+ uint4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7ab4df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7ab4df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7ab4df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl
new file mode 100644
index 0000000..ec80f3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_7ab4df() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_7ab4df();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_7ab4df() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_7ab4df();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_7ab4df() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_7ab4df();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl
new file mode 100644
index 0000000..b4ea0ff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7ab4df(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_7ab4df(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_7ab4df(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_7ab4df(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm
new file mode 100644
index 0000000..14ec9cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_7ab4df "textureLoad_7ab4df"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %29 = OpConstantNull %v4uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_7ab4df = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %29
+ %19 = OpLoad %11 %arg_0
+ %23 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %23
+ %17 = OpImageFetch %v4uint %19 %25 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_7ab4df
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_7ab4df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_7ab4df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl
new file mode 100644
index 0000000..1641a45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_7ab4df() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7ab4df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7ab4df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7ab4df();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl
new file mode 100644
index 0000000..9f17dfd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<u32>, sample_index: i32) -> vec4<i32>
+fn textureLoad_7bee94() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7bee94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7bee94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7bee94();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..637fedd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureLoad_7bee94() {
+ int4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7bee94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7bee94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7bee94();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..637fedd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureLoad_7bee94() {
+ int4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7bee94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7bee94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7bee94();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl
new file mode 100644
index 0000000..0b65e8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_7bee94() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_7bee94();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_7bee94() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_7bee94();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureLoad_7bee94() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_7bee94();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl
new file mode 100644
index 0000000..3b6dd3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7bee94(texture2d_ms<int, access::read> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureLoad_7bee94(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_7bee94(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_7bee94(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm
new file mode 100644
index 0000000..6cebf88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_7bee94 "textureLoad_7bee94"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %22 = OpConstantNull %v2uint
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_7bee94 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %22 Sample %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_7bee94
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_7bee94
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_7bee94
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl
new file mode 100644
index 0000000..a0dce1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureLoad_7bee94() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7bee94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7bee94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7bee94();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl
new file mode 100644
index 0000000..114529e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureLoad(texture: texture_depth_2d, coords: vec2<u32>, level: i32) -> f32
+fn textureLoad_7fd822() {
+ var res: f32 = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7fd822();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7fd822();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7fd822();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c7fda0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureLoad_7fd822() {
+ float res = arg_0.Load(uint3(0u, 0u, uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7fd822();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7fd822();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7fd822();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c7fda0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureLoad_7fd822() {
+ float res = arg_0.Load(uint3(0u, 0u, uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7fd822();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7fd822();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7fd822();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl
new file mode 100644
index 0000000..190b3ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_7fd822() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_7fd822();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_7fd822() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+void fragment_main() {
+ textureLoad_7fd822();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_7fd822() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+void compute_main() {
+ textureLoad_7fd822();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl
new file mode 100644
index 0000000..ae2db23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7fd822(depth2d<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureLoad_7fd822(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_7fd822(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_7fd822(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm
new file mode 100644
index 0000000..afc51da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_7fd822 "textureLoad_7fd822"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %21 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_7fd822 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %21 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_7fd822
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_7fd822
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_7fd822
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl
new file mode 100644
index 0000000..27d783f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureLoad_7fd822() {
+ var res : f32 = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7fd822();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7fd822();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7fd822();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl
new file mode 100644
index 0000000..b5d0434
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureLoad(texture: texture_depth_2d, coords: vec2<i32>, level: u32) -> f32
+fn textureLoad_8ccbe3() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_8ccbe3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_8ccbe3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_8ccbe3();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6f96b70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureLoad_8ccbe3() {
+ float res = arg_0.Load(int3(0, 0, int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_8ccbe3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_8ccbe3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_8ccbe3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6f96b70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureLoad_8ccbe3() {
+ float res = arg_0.Load(int3(0, 0, int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_8ccbe3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_8ccbe3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_8ccbe3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl
new file mode 100644
index 0000000..ece7afb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_8ccbe3() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_8ccbe3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_8ccbe3() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+void fragment_main() {
+ textureLoad_8ccbe3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureLoad_8ccbe3() {
+ float res = texelFetch(arg_0_1, ivec2(0), int(1u)).x;
+}
+
+void compute_main() {
+ textureLoad_8ccbe3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl
new file mode 100644
index 0000000..ac493ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_8ccbe3(depth2d<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureLoad_8ccbe3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_8ccbe3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_8ccbe3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm
new file mode 100644
index 0000000..74a1be6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_8ccbe3 "textureLoad_8ccbe3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %21 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_8ccbe3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %21 Lod %uint_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_8ccbe3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_8ccbe3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_8ccbe3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl
new file mode 100644
index 0000000..ed51a5e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureLoad_8ccbe3() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_8ccbe3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_8ccbe3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_8ccbe3();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl
new file mode 100644
index 0000000..caf7225
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureLoad(texture: texture_3d<u32>, coords: vec3<u32>, level: i32) -> vec4<u32>
+fn textureLoad_92eb1f() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92eb1f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92eb1f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92eb1f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f6223be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_92eb1f() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92eb1f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92eb1f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92eb1f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f6223be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_92eb1f() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92eb1f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92eb1f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92eb1f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl
new file mode 100644
index 0000000..17377b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_92eb1f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_92eb1f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_92eb1f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_92eb1f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureLoad_92eb1f() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_92eb1f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl
new file mode 100644
index 0000000..1ccb382
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_92eb1f(texture3d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint3(uint3(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureLoad_92eb1f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_92eb1f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_92eb1f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm
new file mode 100644
index 0000000..0660252
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_92eb1f "textureLoad_92eb1f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v3uint = OpTypeVector %uint 3
+ %21 = OpConstantNull %v3uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_92eb1f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %21 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_92eb1f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_92eb1f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_92eb1f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl
new file mode 100644
index 0000000..e6000a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureLoad_92eb1f() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92eb1f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92eb1f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92eb1f();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl
new file mode 100644
index 0000000..35fef29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureLoad(texture: texture_2d<i32>, coords: vec2<u32>, level: i32) -> vec4<i32>
+fn textureLoad_9aa733() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9aa733();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9aa733();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9aa733();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..79162bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9aa733() {
+ int4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9aa733();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9aa733();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9aa733();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..79162bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9aa733() {
+ int4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9aa733();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9aa733();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9aa733();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl
new file mode 100644
index 0000000..217cfa1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_9aa733() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_9aa733();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_9aa733() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_9aa733();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_9aa733() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_9aa733();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl
new file mode 100644
index 0000000..961e4e3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9aa733(texture2d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureLoad_9aa733(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_9aa733(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_9aa733(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm
new file mode 100644
index 0000000..6e614d2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9aa733 "textureLoad_9aa733"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %22 = OpConstantNull %v2uint
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_9aa733 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %22 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_9aa733
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_9aa733
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_9aa733
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl
new file mode 100644
index 0000000..10a785e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureLoad_9aa733() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9aa733();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9aa733();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9aa733();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl
new file mode 100644
index 0000000..e666bb0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<i32>
+fn textureLoad_9d70e9() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9d70e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9d70e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9d70e9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0e3ab66
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9d70e9() {
+ int4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9d70e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9d70e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9d70e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0e3ab66
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9d70e9() {
+ int4 res = arg_0.Load(int4(0, 0, 1, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9d70e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9d70e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9d70e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl
new file mode 100644
index 0000000..3d13c69
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9d70e9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_9d70e9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9d70e9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_9d70e9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9d70e9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u));
+}
+
+void compute_main() {
+ textureLoad_9d70e9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl
new file mode 100644
index 0000000..da97933
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9d70e9(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(int2(0)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_9d70e9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_9d70e9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_9d70e9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm
new file mode 100644
index 0000000..ef88f71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9d70e9 "textureLoad_9d70e9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %28 = OpConstantNull %v4int
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_9d70e9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %28
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %23 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_9d70e9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_9d70e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_9d70e9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1bbb29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_9d70e9() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9d70e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9d70e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9d70e9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl
new file mode 100644
index 0000000..1cd4b77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<i32>
+fn textureLoad_9fbfd9() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9fbfd9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9fbfd9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9fbfd9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc0b741
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9fbfd9() {
+ int4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9fbfd9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9fbfd9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9fbfd9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc0b741
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_9fbfd9() {
+ int4 res = arg_0.Load(int4(0, 0, int(1u), int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_9fbfd9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_9fbfd9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9fbfd9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl
new file mode 100644
index 0000000..8cdbcc7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9fbfd9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_9fbfd9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9fbfd9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_9fbfd9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_9fbfd9() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), int(1u));
+}
+
+void compute_main() {
+ textureLoad_9fbfd9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl
new file mode 100644
index 0000000..4c392b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9fbfd9(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_9fbfd9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_9fbfd9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_9fbfd9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm
new file mode 100644
index 0000000..b76f91a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9fbfd9 "textureLoad_9fbfd9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %28 = OpConstantNull %v4int
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_9fbfd9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %28
+ %19 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ %17 = OpImageFetch %v4int %19 %25 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_9fbfd9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_9fbfd9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_9fbfd9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl
new file mode 100644
index 0000000..6de6866
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_9fbfd9() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_9fbfd9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_9fbfd9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_9fbfd9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl
new file mode 100644
index 0000000..6b197d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<u32>
+fn textureLoad_a24be1() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_a24be1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_a24be1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_a24be1();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1570879
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_a24be1() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_a24be1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_a24be1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a24be1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1570879
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_a24be1() {
+ uint4 res = arg_0.Load(uint4(0u, 0u, uint(1), 1u));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_a24be1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_a24be1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a24be1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl
new file mode 100644
index 0000000..1e9bb6c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_a24be1() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_a24be1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_a24be1() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_a24be1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureLoad_a24be1() {
+ uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), int(1u));
+}
+
+void compute_main() {
+ textureLoad_a24be1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl
new file mode 100644
index 0000000..c025426
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a24be1(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureLoad_a24be1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_a24be1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_a24be1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm
new file mode 100644
index 0000000..4182dea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a24be1 "textureLoad_a24be1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %29 = OpConstantNull %v4uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_a24be1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %29
+ %19 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ %17 = OpImageFetch %v4uint %19 %25 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_a24be1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_a24be1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_a24be1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl
new file mode 100644
index 0000000..e938574
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_a24be1() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_a24be1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_a24be1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_a24be1();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl
new file mode 100644
index 0000000..0430762
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<i32>
+fn textureLoad_b29f71() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b29f71();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b29f71();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b29f71();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6e13a63
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_b29f71() {
+ int4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b29f71();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b29f71();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b29f71();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6e13a63
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_b29f71() {
+ int4 res = arg_0.Load(int4(0, 0, int(1u), 1));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b29f71();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b29f71();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b29f71();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl
new file mode 100644
index 0000000..68402f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_b29f71() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_b29f71();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_b29f71() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_b29f71();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureLoad_b29f71() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_b29f71();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl
new file mode 100644
index 0000000..2ee5823
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b29f71(texture2d_array<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(int2(0)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureLoad_b29f71(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_b29f71(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_b29f71(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm
new file mode 100644
index 0000000..dc7ad1c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b29f71 "textureLoad_b29f71"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %29 = OpConstantNull %v4int
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_b29f71 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %29
+ %19 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ %17 = OpImageFetch %v4int %19 %25 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_b29f71
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_b29f71
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_b29f71
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff9172d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_b29f71() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b29f71();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b29f71();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b29f71();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl
new file mode 100644
index 0000000..3839395
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: i32, level: i32) -> f32
+fn textureLoad_b6ba5d() {
+ var res: f32 = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b6ba5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b6ba5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b6ba5d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e01eb1d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_b6ba5d() {
+ float res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b6ba5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b6ba5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b6ba5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e01eb1d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_b6ba5d() {
+ float res = arg_0.Load(uint4(0u, 0u, uint(1), uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b6ba5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b6ba5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b6ba5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl
new file mode 100644
index 0000000..aa48aab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_b6ba5d() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_b6ba5d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_b6ba5d() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1).x;
+}
+
+void fragment_main() {
+ textureLoad_b6ba5d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_b6ba5d() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, uint(1))), 1).x;
+}
+
+void compute_main() {
+ textureLoad_b6ba5d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl
new file mode 100644
index 0000000..e2c7340
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b6ba5d(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(uint2(0u)), 1, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_b6ba5d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_b6ba5d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_b6ba5d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0063b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b6ba5d "textureLoad_b6ba5d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_b6ba5d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %25 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ %17 = OpImageFetch %v4float %18 %25 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_b6ba5d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_b6ba5d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_b6ba5d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl
new file mode 100644
index 0000000..03eb225
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_b6ba5d() {
+ var res : f32 = textureLoad(arg_0, vec2<u32>(), 1i, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b6ba5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b6ba5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b6ba5d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl
new file mode 100644
index 0000000..23f48da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureLoad(texture: texture_2d<u32>, coords: vec2<u32>, level: i32) -> vec4<u32>
+fn textureLoad_b73f6b() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b73f6b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b73f6b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b73f6b();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9d694aa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_b73f6b() {
+ uint4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b73f6b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b73f6b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b73f6b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9d694aa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_b73f6b() {
+ uint4 res = arg_0.Load(uint3(0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b73f6b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b73f6b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b73f6b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl
new file mode 100644
index 0000000..b9f8285
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_b73f6b() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_b73f6b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_b73f6b() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_b73f6b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_b73f6b() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_b73f6b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl
new file mode 100644
index 0000000..2515e7f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b73f6b(texture2d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureLoad_b73f6b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_b73f6b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_b73f6b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm
new file mode 100644
index 0000000..991603f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b73f6b "textureLoad_b73f6b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v2uint = OpTypeVector %uint 2
+ %21 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_b73f6b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %21 Lod %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_b73f6b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_b73f6b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_b73f6b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl
new file mode 100644
index 0000000..074690f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureLoad_b73f6b() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b73f6b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b73f6b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b73f6b();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl
new file mode 100644
index 0000000..6a6a232
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<i32>, sample_index: u32) -> vec4<f32>
+fn textureLoad_b75d4a() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b75d4a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b75d4a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b75d4a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1b77601
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_b75d4a() {
+ float4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b75d4a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b75d4a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b75d4a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1b77601
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_b75d4a() {
+ float4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_b75d4a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_b75d4a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b75d4a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl
new file mode 100644
index 0000000..29de15d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_b75d4a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_b75d4a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_b75d4a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_b75d4a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_b75d4a() {
+ vec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_b75d4a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl
new file mode 100644
index 0000000..cb1c017
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b75d4a(texture2d_ms<float, access::read> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureLoad_b75d4a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_b75d4a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_b75d4a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm
new file mode 100644
index 0000000..56442d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b75d4a "textureLoad_b75d4a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %20 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_b75d4a = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Sample %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_b75d4a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_b75d4a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_b75d4a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl
new file mode 100644
index 0000000..9a592a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureLoad_b75d4a() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_b75d4a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_b75d4a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_b75d4a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl
new file mode 100644
index 0000000..ae600b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureLoad(texture: texture_3d<f32>, coords: vec3<u32>, level: i32) -> vec4<f32>
+fn textureLoad_bcbb3c() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bcbb3c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bcbb3c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bcbb3c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8a88e0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_bcbb3c() {
+ float4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bcbb3c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bcbb3c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bcbb3c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8a88e0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_bcbb3c() {
+ float4 res = arg_0.Load(uint4(0u, 0u, 0u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bcbb3c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bcbb3c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bcbb3c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl
new file mode 100644
index 0000000..008c403
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_bcbb3c() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_bcbb3c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_bcbb3c() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_bcbb3c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureLoad_bcbb3c() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_bcbb3c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl
new file mode 100644
index 0000000..c22a9b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_bcbb3c(texture3d<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint3(uint3(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureLoad_bcbb3c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_bcbb3c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_bcbb3c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm
new file mode 100644
index 0000000..637018c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_bcbb3c "textureLoad_bcbb3c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %20 = OpConstantNull %v3uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_bcbb3c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_bcbb3c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_bcbb3c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_bcbb3c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl
new file mode 100644
index 0000000..a968218
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureLoad_bcbb3c() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bcbb3c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bcbb3c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bcbb3c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl
new file mode 100644
index 0000000..75e8289
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: u32, level: i32) -> f32
+fn textureLoad_c16e00() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_c16e00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_c16e00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_c16e00();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..322a9ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_c16e00() {
+ float res = arg_0.Load(int4(0, 0, int(1u), 1)).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_c16e00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_c16e00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c16e00();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..322a9ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_c16e00() {
+ float res = arg_0.Load(int4(0, 0, int(1u), 1)).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_c16e00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_c16e00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c16e00();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl
new file mode 100644
index 0000000..62fbdb9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_c16e00() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_c16e00();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_c16e00() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1).x;
+}
+
+void fragment_main() {
+ textureLoad_c16e00();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_c16e00() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, int(1u)), 1).x;
+}
+
+void compute_main() {
+ textureLoad_c16e00();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl
new file mode 100644
index 0000000..8159c0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c16e00(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(int2(0)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_c16e00(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_c16e00(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_c16e00(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm
new file mode 100644
index 0000000..64906d9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c16e00 "textureLoad_c16e00"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_c16e00 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %25 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ %17 = OpImageFetch %v4float %18 %25 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_c16e00
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_c16e00
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_c16e00
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a7cf77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_c16e00() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_c16e00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_c16e00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_c16e00();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl
new file mode 100644
index 0000000..25ac317
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<i32>, sample_index: u32) -> vec4<u32>
+fn textureLoad_cad5f2() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cad5f2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cad5f2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cad5f2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0f93cc8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_cad5f2() {
+ uint4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cad5f2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cad5f2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cad5f2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0f93cc8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_cad5f2() {
+ uint4 res = arg_0.Load((0).xx, 1u);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cad5f2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cad5f2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cad5f2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl
new file mode 100644
index 0000000..9e82ddf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_cad5f2() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_cad5f2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_cad5f2() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_cad5f2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_cad5f2() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_cad5f2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl
new file mode 100644
index 0000000..8cc1c1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_cad5f2(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureLoad_cad5f2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_cad5f2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_cad5f2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm
new file mode 100644
index 0000000..7097846
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_cad5f2 "textureLoad_cad5f2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %22 = OpConstantNull %v2int
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_cad5f2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Sample %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_cad5f2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_cad5f2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_cad5f2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl
new file mode 100644
index 0000000..1420f61
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureLoad_cad5f2() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cad5f2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cad5f2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cad5f2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl
new file mode 100644
index 0000000..89a146b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: u32, level: i32) -> f32
+fn textureLoad_cb57c2() {
+ var res: f32 = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cb57c2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cb57c2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cb57c2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..79442d0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_cb57c2() {
+ float res = arg_0.Load(uint4(0u, 0u, 1u, uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cb57c2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cb57c2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cb57c2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..79442d0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_cb57c2() {
+ float res = arg_0.Load(uint4(0u, 0u, 1u, uint(1))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cb57c2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cb57c2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cb57c2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl
new file mode 100644
index 0000000..f71215d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_cb57c2() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_cb57c2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_cb57c2() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1).x;
+}
+
+void fragment_main() {
+ textureLoad_cb57c2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_cb57c2() {
+ float res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1).x;
+}
+
+void compute_main() {
+ textureLoad_cb57c2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl
new file mode 100644
index 0000000..893d800
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_cb57c2(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(uint2(0u)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_cb57c2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_cb57c2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_cb57c2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm
new file mode 100644
index 0000000..68a2176
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_cb57c2 "textureLoad_cb57c2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %23 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_cb57c2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %23 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_cb57c2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_cb57c2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_cb57c2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl
new file mode 100644
index 0000000..3cd1cd3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_cb57c2() {
+ var res : f32 = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cb57c2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cb57c2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cb57c2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl
new file mode 100644
index 0000000..68abe1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureLoad(texture: texture_3d<i32>, coords: vec3<i32>, level: u32) -> vec4<i32>
+fn textureLoad_e35f72() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e35f72();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e35f72();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e35f72();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..de8d7fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_e35f72() {
+ int4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e35f72();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e35f72();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e35f72();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..de8d7fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_e35f72() {
+ int4 res = arg_0.Load(int4(0, 0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e35f72();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e35f72();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e35f72();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl
new file mode 100644
index 0000000..0117c1a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_e35f72() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_e35f72();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_e35f72() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_e35f72();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureLoad_e35f72() {
+ ivec4 res = texelFetch(arg_0_1, ivec3(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_e35f72();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl
new file mode 100644
index 0000000..d26d358
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e35f72(texture3d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint3(int3(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureLoad_e35f72(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_e35f72(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_e35f72(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm
new file mode 100644
index 0000000..69920c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_e35f72 "textureLoad_e35f72"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %21 = OpConstantNull %v3int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_e35f72 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_e35f72
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_e35f72
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_e35f72
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl
new file mode 100644
index 0000000..2e8197d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureLoad_e35f72() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e35f72();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e35f72();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e35f72();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl
new file mode 100644
index 0000000..4ee85a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureLoad(texture: texture_2d<u32>, coords: vec2<i32>, level: u32) -> vec4<u32>
+fn textureLoad_ebfb92() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_ebfb92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_ebfb92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_ebfb92();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ef22fda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_ebfb92() {
+ uint4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_ebfb92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_ebfb92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ebfb92();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ef22fda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_ebfb92() {
+ uint4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_ebfb92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_ebfb92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ebfb92();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl
new file mode 100644
index 0000000..6176e8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_ebfb92() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_ebfb92();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_ebfb92() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_ebfb92();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureLoad_ebfb92() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_ebfb92();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl
new file mode 100644
index 0000000..1310118
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_ebfb92(texture2d<uint, access::sample> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureLoad_ebfb92(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_ebfb92(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_ebfb92(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm
new file mode 100644
index 0000000..4e03907
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_ebfb92 "textureLoad_ebfb92"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %22 = OpConstantNull %v2int
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_ebfb92 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_ebfb92
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_ebfb92
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_ebfb92
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2dd172
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureLoad_ebfb92() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_ebfb92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_ebfb92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_ebfb92();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl
new file mode 100644
index 0000000..96f2bca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<u32>, sample_index: i32) -> vec4<f32>
+fn textureLoad_f0abad() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f0abad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f0abad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f0abad();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0612336
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f0abad() {
+ float4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f0abad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f0abad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f0abad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0612336
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f0abad() {
+ float4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f0abad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f0abad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f0abad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl
new file mode 100644
index 0000000..d5d441c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_f0abad() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_f0abad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_f0abad() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_f0abad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_f0abad() {
+ vec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_f0abad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl
new file mode 100644
index 0000000..75cdfbf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f0abad(texture2d_ms<float, access::read> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureLoad_f0abad(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_f0abad(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_f0abad(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm
new file mode 100644
index 0000000..e60070d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f0abad "textureLoad_f0abad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %20 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f0abad = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Sample %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_f0abad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_f0abad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_f0abad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl
new file mode 100644
index 0000000..f422c02
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureLoad_f0abad() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f0abad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f0abad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f0abad();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl
new file mode 100644
index 0000000..105dab7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<f32>
+fn textureLoad_f348d9() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f348d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f348d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f348d9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc20744
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f348d9() {
+ float4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f348d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f348d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f348d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc20744
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f348d9() {
+ float4 res = arg_0.Load(uint4(0u, 0u, 1u, uint(1)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f348d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f348d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f348d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl
new file mode 100644
index 0000000..9302278
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_f348d9() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_f348d9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_f348d9() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_f348d9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_f348d9() {
+ vec4 res = texelFetch(arg_0_1, ivec3(uvec3(0u, 0u, 1u)), 1);
+}
+
+void compute_main() {
+ textureLoad_f348d9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl
new file mode 100644
index 0000000..65f4407
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f348d9(texture2d_array<float, access::sample> tint_symbol_1) {
+ float4 res = tint_symbol_1.read(uint2(uint2(0u)), 1u, 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_f348d9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_f348d9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_f348d9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm
new file mode 100644
index 0000000..0c617c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f348d9 "textureLoad_f348d9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f348d9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %17 = OpLoad %11 %arg_0
+ %16 = OpImageFetch %v4float %17 %22 Lod %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_f348d9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_f348d9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_f348d9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl
new file mode 100644
index 0000000..7b599f1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_f348d9() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f348d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f348d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f348d9();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl
new file mode 100644
index 0000000..fcd1f60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureLoad(texture: texture_2d<i32>, coords: vec2<i32>, level: u32) -> vec4<i32>
+fn textureLoad_f85291() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f85291();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f85291();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f85291();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2f163b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_f85291() {
+ int4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f85291();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f85291();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f85291();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2f163b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_f85291() {
+ int4 res = arg_0.Load(int3(0, 0, int(1u)));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f85291();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f85291();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f85291();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl
new file mode 100644
index 0000000..8051539
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_f85291() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+vec4 vertex_main() {
+ textureLoad_f85291();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_f85291() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void fragment_main() {
+ textureLoad_f85291();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureLoad_f85291() {
+ ivec4 res = texelFetch(arg_0_1, ivec2(0), int(1u));
+}
+
+void compute_main() {
+ textureLoad_f85291();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl
new file mode 100644
index 0000000..5c0fefd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f85291(texture2d<int, access::sample> tint_symbol_1) {
+ int4 res = tint_symbol_1.read(uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureLoad_f85291(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_f85291(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_f85291(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm
new file mode 100644
index 0000000..00b2ab5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f85291 "textureLoad_f85291"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %21 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f85291 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Lod %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_f85291
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_f85291
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_f85291
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl
new file mode 100644
index 0000000..56f3c1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureLoad_f85291() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f85291();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f85291();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f85291();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl
new file mode 100644
index 0000000..b8e63aa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<u32>, sample_index: i32) -> f32
+fn textureLoad_fcd23d() {
+ var res: f32 = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_fcd23d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_fcd23d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_fcd23d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ca9a66
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_fcd23d() {
+ float res = arg_0.Load(uint3(0u, 0u, uint(0)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_fcd23d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_fcd23d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fcd23d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ca9a66
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_fcd23d() {
+ float res = arg_0.Load(uint3(0u, 0u, uint(0)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_fcd23d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_fcd23d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fcd23d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl
new file mode 100644
index 0000000..87e28c88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_fcd23d() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_fcd23d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_fcd23d() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+void fragment_main() {
+ textureLoad_fcd23d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureLoad_fcd23d() {
+ float res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1).x;
+}
+
+void compute_main() {
+ textureLoad_fcd23d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl
new file mode 100644
index 0000000..159dd8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_fcd23d(depth2d_ms<float, access::read> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureLoad_fcd23d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_fcd23d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_fcd23d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm
new file mode 100644
index 0000000..c504a4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_fcd23d "textureLoad_fcd23d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %21 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_fcd23d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %21 Sample %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_fcd23d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_fcd23d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_fcd23d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl
new file mode 100644
index 0000000..8c90ff7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureLoad_fcd23d() {
+ var res : f32 = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_fcd23d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_fcd23d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_fcd23d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl
new file mode 100644
index 0000000..a85f8c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<u32>, sample_index: i32) -> vec4<u32>
+fn textureLoad_fe0565() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_fe0565();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_fe0565();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_fe0565();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d4b0633
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_fe0565() {
+ uint4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_fe0565();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_fe0565();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fe0565();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d4b0633
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_fe0565() {
+ uint4 res = arg_0.Load((0u).xx, 1);
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_fe0565();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_fe0565();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fe0565();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl
new file mode 100644
index 0000000..5447511
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_fe0565() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+vec4 vertex_main() {
+ textureLoad_fe0565();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_fe0565() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void fragment_main() {
+ textureLoad_fe0565();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureLoad_fe0565() {
+ uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(0u)), 1);
+}
+
+void compute_main() {
+ textureLoad_fe0565();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl
new file mode 100644
index 0000000..7e87a5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_fe0565(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint4 res = tint_symbol_1.read(uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureLoad_fe0565(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_fe0565(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_fe0565(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm
new file mode 100644
index 0000000..9a345fb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_fe0565 "textureLoad_fe0565"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %v2uint = OpTypeVector %uint 2
+ %21 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_fe0565 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4uint %19 %21 Sample %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_fe0565
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_fe0565
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_fe0565
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl
new file mode 100644
index 0000000..6aba3a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureLoad_fe0565() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(), 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_fe0565();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_fe0565();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_fe0565();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl
new file mode 100644
index 0000000..4c5826b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: i32, level: u32) -> f32
+fn textureLoad_ff1119() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_ff1119();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_ff1119();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_ff1119();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4b0e14e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_ff1119() {
+ float res = arg_0.Load(int4(0, 0, 1, int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_ff1119();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_ff1119();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ff1119();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4b0e14e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_ff1119() {
+ float res = arg_0.Load(int4(0, 0, 1, int(1u))).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_ff1119();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_ff1119();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ff1119();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl
new file mode 100644
index 0000000..3a05870
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_ff1119() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u)).x;
+}
+
+vec4 vertex_main() {
+ textureLoad_ff1119();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_ff1119() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u)).x;
+}
+
+void fragment_main() {
+ textureLoad_ff1119();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureLoad_ff1119() {
+ float res = texelFetch(arg_0_1, ivec3(0, 0, 1), int(1u)).x;
+}
+
+void compute_main() {
+ textureLoad_ff1119();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl
new file mode 100644
index 0000000..f136a44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_ff1119(depth2d_array<float, access::sample> tint_symbol_1) {
+ float res = tint_symbol_1.read(uint2(int2(0)), 1, 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureLoad_ff1119(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureLoad_ff1119(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureLoad_ff1119(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm
new file mode 100644
index 0000000..faa0652
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_ff1119 "textureLoad_ff1119"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_ff1119 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageFetch %v4float %18 %23 Lod %uint_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_ff1119
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_ff1119
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_ff1119
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl
new file mode 100644
index 0000000..de0e81a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_ff1119() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_ff1119();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_ff1119();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_ff1119();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl
new file mode 100644
index 0000000..3343ac7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: u32) -> f32
+fn textureSampleLevel_2974eb() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_2974eb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_2974eb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_2974eb();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d761407
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_2974eb() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_2974eb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_2974eb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_2974eb();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d761407
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_2974eb() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_2974eb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_2974eb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_2974eb();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl
new file mode 100644
index 0000000..d2d5df8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_2974eb() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_2974eb();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLod' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_2974eb() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u));
+}
+
+void fragment_main() {
+ textureSampleLevel_2974eb();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:7: 'textureLod' : no matching overloaded function found
+ERROR: 0:7: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_2974eb() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u));
+}
+
+void compute_main() {
+ textureSampleLevel_2974eb();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLod' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl
new file mode 100644
index 0000000..35c8142
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_2974eb(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float2(0.0f), 1, level(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_2974eb(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_2974eb(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_2974eb(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm
new file mode 100644
index 0000000..902d1d2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_2974eb "textureSampleLevel_2974eb"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_2974eb = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %uint_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod %31
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_2974eb
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureSampleLevel_2974eb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureSampleLevel_2974eb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl
new file mode 100644
index 0000000..a01f59b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_2974eb() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_2974eb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_2974eb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_2974eb();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl
new file mode 100644
index 0000000..a9d9e0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: u32, @const offset: vec2<i32>) -> f32
+fn textureSampleLevel_36f0d3() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1i, 1u, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_36f0d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_36f0d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_36f0d3();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b36c713
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_36f0d3() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1u, (0).xx).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_36f0d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_36f0d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_36f0d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b36c713
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_36f0d3() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1u, (0).xx).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_36f0d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_36f0d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_36f0d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl
new file mode 100644
index 0000000..6c1e027
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_36f0d3() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u), ivec2(0));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_36f0d3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_36f0d3() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u), ivec2(0));
+}
+
+void fragment_main() {
+ textureSampleLevel_36f0d3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:7: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:7: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_36f0d3() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1u), ivec2(0));
+}
+
+void compute_main() {
+ textureSampleLevel_36f0d3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl
new file mode 100644
index 0000000..a952104
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_36f0d3(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float2(0.0f), 1, level(1u), int2(0));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_36f0d3(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_36f0d3(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_36f0d3(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm
new file mode 100644
index 0000000..aaa56db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_36f0d3 "textureSampleLevel_36f0d3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v2int = OpTypeVector %int 2
+ %35 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_36f0d3 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %uint_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod|ConstOffset %31 %35
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureSampleLevel_36f0d3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_36f0d3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureSampleLevel_36f0d3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl
new file mode 100644
index 0000000..79a45ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_36f0d3() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1i, 1u, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_36f0d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_36f0d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_36f0d3();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl
new file mode 100644
index 0000000..3d2edc9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: i32) -> f32
+fn textureSampleLevel_3c3442() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_3c3442();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_3c3442();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_3c3442();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..39cd161
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_3c3442() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1u)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_3c3442();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_3c3442();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_3c3442();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..39cd161
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_3c3442() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1u)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_3c3442();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_3c3442();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_3c3442();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl
new file mode 100644
index 0000000..ecf8622
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_3c3442() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_3c3442();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLod' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_3c3442() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1));
+}
+
+void fragment_main() {
+ textureSampleLevel_3c3442();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:7: 'textureLod' : no matching overloaded function found
+ERROR: 0:7: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_3c3442() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1));
+}
+
+void compute_main() {
+ textureSampleLevel_3c3442();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLod' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl
new file mode 100644
index 0000000..ce8ebea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_3c3442(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float2(0.0f), 1u, level(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_3c3442(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_3c3442(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_3c3442(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm
new file mode 100644
index 0000000..2300632
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_3c3442 "textureSampleLevel_3c3442"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_3c3442 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertUToF %float %uint_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod %31
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_3c3442
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureSampleLevel_3c3442
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureSampleLevel_3c3442
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl
new file mode 100644
index 0000000..62d0573ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_3c3442() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_3c3442();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_3c3442();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_3c3442();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl
new file mode 100644
index 0000000..d02337a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: i32, level: u32) -> f32
+fn textureSampleLevel_a12142() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_a12142();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_a12142();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_a12142();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..881bbdb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_a12142() {
+ float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_a12142();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_a12142();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_a12142();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..881bbdb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_a12142() {
+ float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1u).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_a12142();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_a12142();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_a12142();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl
new file mode 100644
index 0000000..278f53a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_a12142() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1u));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_a12142();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_a12142() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1u));
+}
+
+void fragment_main() {
+ textureSampleLevel_a12142();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_a12142() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1u));
+}
+
+void compute_main() {
+ textureSampleLevel_a12142();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl
new file mode 100644
index 0000000..e2e6c7d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_a12142(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float3(0.0f), 1, level(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_a12142(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_a12142(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_a12142(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm
new file mode 100644
index 0000000..e3114b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_a12142 "textureSampleLevel_a12142"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_a12142 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %26
+ %30 = OpConvertSToF %float %uint_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %29 Lod %30
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_a12142
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_a12142
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_a12142
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl
new file mode 100644
index 0000000..6644810
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_a12142() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1i, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_a12142();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_a12142();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_a12142();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl
new file mode 100644
index 0000000..7894b70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: i32, @const offset: vec2<i32>) -> f32
+fn textureSampleLevel_e6ce9e() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1u, 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_e6ce9e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_e6ce9e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_e6ce9e();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..62c3ca3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_e6ce9e() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1u)), 1, (0).xx).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_e6ce9e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_e6ce9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_e6ce9e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..62c3ca3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_e6ce9e() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1u)), 1, (0).xx).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_e6ce9e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_e6ce9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_e6ce9e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl
new file mode 100644
index 0000000..203b99a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_e6ce9e() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1), ivec2(0));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_e6ce9e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_e6ce9e() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1), ivec2(0));
+}
+
+void fragment_main() {
+ textureSampleLevel_e6ce9e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:7: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:7: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_e6ce9e() {
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1u), 0.0f), float(1), ivec2(0));
+}
+
+void compute_main() {
+ textureSampleLevel_e6ce9e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureLodOffset' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl
new file mode 100644
index 0000000..cdf6cd4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_e6ce9e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float2(0.0f), 1u, level(1), int2(0));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_e6ce9e(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_e6ce9e(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_e6ce9e(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..387a582
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_e6ce9e "textureSampleLevel_e6ce9e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %v3float = OpTypeVector %float 3
+ %float_0 = OpConstant %float 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2int = OpTypeVector %int 2
+ %35 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_e6ce9e = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertUToF %float %uint_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod|ConstOffset %31 %35
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..765f731
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_e6ce9e() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1u, 1i, vec2<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_e6ce9e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_e6ce9e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_e6ce9e();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl
new file mode 100644
index 0000000..6407b2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+@group(1) @binding(1) var arg_1: sampler;
+
+// fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: u32, level: i32) -> f32
+fn textureSampleLevel_ff11bc() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_ff11bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_ff11bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_ff11bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..aaffccf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_ff11bc() {
+ float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1u)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_ff11bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_ff11bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_ff11bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..aaffccf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,33 @@
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_ff11bc() {
+ float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1u)), 1).x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureSampleLevel_ff11bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureSampleLevel_ff11bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_ff11bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl
new file mode 100644
index 0000000..dd5a844
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_ff11bc() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1u)), float(1));
+}
+
+vec4 vertex_main() {
+ textureSampleLevel_ff11bc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_ff11bc() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1u)), float(1));
+}
+
+void fragment_main() {
+ textureSampleLevel_ff11bc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArrayShadow arg_0_arg_1;
+
+void textureSampleLevel_ff11bc() {
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1u)), float(1));
+}
+
+void compute_main() {
+ textureSampleLevel_ff11bc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl
new file mode 100644
index 0000000..2791c64
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_ff11bc(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+ float res = tint_symbol_1.sample(tint_symbol_2, float3(0.0f), 1u, level(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
+ textureSampleLevel_ff11bc(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
+ textureSampleLevel_ff11bc(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
+ textureSampleLevel_ff11bc(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..9fb572a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_ff11bc "textureSampleLevel_ff11bc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %14 = OpTypeSampler
+%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
+ %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %11
+ %float_0 = OpConstant %float 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_ff11bc = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ %21 = OpLoad %14 %arg_1
+ %22 = OpLoad %11 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %26 = OpConvertUToF %float %uint_1
+ %29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %26
+ %30 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %29 Lod %30
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_ff11bc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_ff11bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_ff11bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..43278dd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+@group(1) @binding(1) var arg_1 : sampler;
+
+fn textureSampleLevel_ff11bc() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1u, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureSampleLevel_ff11bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureSampleLevel_ff11bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureSampleLevel_ff11bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl
new file mode 100644
index 0000000..127f5d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32uint, write>, coords: vec2<i32>, array_index: u32, value: vec4<u32>)
+fn textureStore_00ca64() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_00ca64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_00ca64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_00ca64();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4c43d09
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_00ca64() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_00ca64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_00ca64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_00ca64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4c43d09
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_00ca64() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_00ca64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_00ca64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_00ca64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.glsl
new file mode 100644
index 0000000..1227661
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_00ca64() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_00ca64();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_00ca64() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_00ca64();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_00ca64() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_00ca64();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.msl
new file mode 100644
index 0000000..61e534f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_00ca64(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_00ca64(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_00ca64(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_00ca64(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.spvasm
new file mode 100644
index 0000000..ec49a65
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_00ca64 "textureStore_00ca64"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_00ca64 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_00ca64
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_00ca64
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_00ca64
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.wgsl
new file mode 100644
index 0000000..6bc9e2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureStore_00ca64() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_00ca64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_00ca64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_00ca64();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl
new file mode 100644
index 0000000..10d0c4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32sint, write>, coords: vec2<u32>, array_index: i32, value: vec4<i32>)
+fn textureStore_0148bd() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0148bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0148bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0148bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..49a4ea9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_0148bd() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0148bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0148bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0148bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..49a4ea9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_0148bd() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0148bd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0148bd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0148bd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.glsl
new file mode 100644
index 0000000..5b2168a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0148bd() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_0148bd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0148bd() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_0148bd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0148bd() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_0148bd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.msl
new file mode 100644
index 0000000..508c653
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0148bd(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_0148bd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_0148bd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_0148bd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.spvasm
new file mode 100644
index 0000000..464aac9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0148bd "textureStore_0148bd"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_0148bd = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_0148bd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_0148bd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_0148bd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.wgsl
new file mode 100644
index 0000000..b9cae8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureStore_0148bd() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0148bd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0148bd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0148bd();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl
new file mode 100644
index 0000000..1c43f8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32float, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_06e49c() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_06e49c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_06e49c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_06e49c();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7ccdde8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_06e49c() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_06e49c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_06e49c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_06e49c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7ccdde8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_06e49c() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_06e49c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_06e49c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_06e49c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.glsl
new file mode 100644
index 0000000..1c9a1cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_06e49c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_06e49c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_06e49c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_06e49c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_06e49c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_06e49c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.msl
new file mode 100644
index 0000000..feafa4d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_06e49c(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_06e49c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_06e49c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_06e49c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.spvasm
new file mode 100644
index 0000000..be0e588
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_06e49c "textureStore_06e49c"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_06e49c = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_06e49c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_06e49c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_06e49c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.wgsl
new file mode 100644
index 0000000..b9ddf2e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureStore_06e49c() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_06e49c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_06e49c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_06e49c();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl
new file mode 100644
index 0000000..3899f39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8uint, write>, coords: vec2<u32>, array_index: i32, value: vec4<u32>)
+fn textureStore_0a1a79() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0a1a79();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0a1a79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0a1a79();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..872f431
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_0a1a79() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0a1a79();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0a1a79();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0a1a79();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..872f431
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_0a1a79() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0a1a79();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0a1a79();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0a1a79();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.glsl
new file mode 100644
index 0000000..7aacbb9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_0a1a79() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_0a1a79();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_0a1a79() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_0a1a79();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_0a1a79() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_0a1a79();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.msl
new file mode 100644
index 0000000..05cd137
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0a1a79(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_0a1a79(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_0a1a79(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_0a1a79(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a4e581
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0a1a79 "textureStore_0a1a79"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_0a1a79 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_0a1a79
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_0a1a79
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_0a1a79
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c98262
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureStore_0a1a79() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0a1a79();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0a1a79();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0a1a79();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl
new file mode 100644
index 0000000..65e450c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16sint, write>, coords: vec2<u32>, array_index: i32, value: vec4<i32>)
+fn textureStore_0cc825() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0cc825();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0cc825();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0cc825();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bf58d44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_0cc825() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0cc825();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0cc825();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0cc825();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bf58d44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_0cc825() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0cc825();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0cc825();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0cc825();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.glsl
new file mode 100644
index 0000000..e22d8d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0cc825() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_0cc825();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0cc825() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_0cc825();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_0cc825() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_0cc825();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.msl
new file mode 100644
index 0000000..5f737ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0cc825(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_0cc825(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_0cc825(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_0cc825(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.spvasm
new file mode 100644
index 0000000..1eeb64f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0cc825 "textureStore_0cc825"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_0cc825 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_0cc825
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_0cc825
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_0cc825
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.wgsl
new file mode 100644
index 0000000..9a44567
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureStore_0cc825() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0cc825();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0cc825();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0cc825();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl
new file mode 100644
index 0000000..5a8267a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16sint, write>, coords: vec2<i32>, array_index: u32, value: vec4<i32>)
+fn textureStore_1f1ef8() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1f1ef8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1f1ef8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1f1ef8();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c38dfe8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_1f1ef8() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1f1ef8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1f1ef8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1f1ef8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c38dfe8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_1f1ef8() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1f1ef8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1f1ef8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1f1ef8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.glsl
new file mode 100644
index 0000000..72a9bec5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_1f1ef8() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_1f1ef8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_1f1ef8() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_1f1ef8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_1f1ef8() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_1f1ef8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.msl
new file mode 100644
index 0000000..b85f5e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1f1ef8(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_1f1ef8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_1f1ef8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_1f1ef8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.spvasm
new file mode 100644
index 0000000..6aff314
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1f1ef8 "textureStore_1f1ef8"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_1f1ef8 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_1f1ef8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_1f1ef8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_1f1ef8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.wgsl
new file mode 100644
index 0000000..1651670
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureStore_1f1ef8() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1f1ef8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1f1ef8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1f1ef8();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl
new file mode 100644
index 0000000..415716e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8snorm, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_22f045() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_22f045();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_22f045();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_22f045();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ae1649c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_22f045() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_22f045();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_22f045();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_22f045();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ae1649c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_22f045() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_22f045();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_22f045();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_22f045();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.glsl
new file mode 100644
index 0000000..204ab9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_22f045() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_22f045();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_22f045() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_22f045();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_22f045() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_22f045();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.msl
new file mode 100644
index 0000000..f07f39f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_22f045(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_22f045(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_22f045(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_22f045(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.spvasm
new file mode 100644
index 0000000..69ce3d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_22f045 "textureStore_22f045"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_22f045 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_22f045
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_22f045
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_22f045
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.wgsl
new file mode 100644
index 0000000..688f6a4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureStore_22f045() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_22f045();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_22f045();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_22f045();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl
new file mode 100644
index 0000000..09b48b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32uint, write>, coords: vec2<u32>, array_index: i32, value: vec4<u32>)
+fn textureStore_2383fc() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2383fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2383fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2383fc();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3e78178
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_2383fc() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2383fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2383fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2383fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3e78178
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_2383fc() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2383fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2383fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2383fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.glsl
new file mode 100644
index 0000000..6691080
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_2383fc() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_2383fc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_2383fc() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_2383fc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_2383fc() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_2383fc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.msl
new file mode 100644
index 0000000..b56a39a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2383fc(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_2383fc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_2383fc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_2383fc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.spvasm
new file mode 100644
index 0000000..4b7a731
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2383fc "textureStore_2383fc"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_2383fc = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_2383fc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_2383fc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_2383fc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.wgsl
new file mode 100644
index 0000000..58bfd01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureStore_2383fc() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2383fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2383fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2383fc();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl
new file mode 100644
index 0000000..a0c5fcb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8unorm, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_258ab0() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_258ab0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_258ab0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_258ab0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60afdb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_258ab0() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_258ab0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_258ab0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_258ab0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60afdb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_258ab0() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_258ab0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_258ab0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_258ab0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.glsl
new file mode 100644
index 0000000..8590cc9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_258ab0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_258ab0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_258ab0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_258ab0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_258ab0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_258ab0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.msl
new file mode 100644
index 0000000..0a3abff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_258ab0(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_258ab0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_258ab0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_258ab0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.spvasm
new file mode 100644
index 0000000..3333cbe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_258ab0 "textureStore_258ab0"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_258ab0 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_258ab0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_258ab0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_258ab0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.wgsl
new file mode 100644
index 0000000..40d4997
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureStore_258ab0() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_258ab0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_258ab0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_258ab0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl
new file mode 100644
index 0000000..1146908
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32sint, write>, coords: vec2<u32>, array_index: i32, value: vec4<i32>)
+fn textureStore_28a7ec() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_28a7ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_28a7ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_28a7ec();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..828727c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_28a7ec() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_28a7ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_28a7ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_28a7ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..828727c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_28a7ec() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_28a7ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_28a7ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_28a7ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.glsl
new file mode 100644
index 0000000..53936c4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_28a7ec() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_28a7ec();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_28a7ec() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_28a7ec();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_28a7ec() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_28a7ec();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.msl
new file mode 100644
index 0000000..65d7504
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_28a7ec(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_28a7ec(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_28a7ec(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_28a7ec(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.spvasm
new file mode 100644
index 0000000..51ce8d9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_28a7ec "textureStore_28a7ec"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_28a7ec = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_28a7ec
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_28a7ec
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_28a7ec
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.wgsl
new file mode 100644
index 0000000..01b44fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureStore_28a7ec() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_28a7ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_28a7ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_28a7ec();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl
new file mode 100644
index 0000000..b4d61dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32sint, write>, coords: vec2<i32>, array_index: u32, value: vec4<i32>)
+fn textureStore_30b0b0() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_30b0b0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_30b0b0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_30b0b0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..21e26cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_30b0b0() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_30b0b0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_30b0b0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_30b0b0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..21e26cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_30b0b0() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_30b0b0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_30b0b0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_30b0b0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.glsl
new file mode 100644
index 0000000..6e95a8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_30b0b0() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_30b0b0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_30b0b0() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_30b0b0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_30b0b0() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_30b0b0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.msl
new file mode 100644
index 0000000..540c35a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_30b0b0(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_30b0b0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_30b0b0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_30b0b0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.spvasm
new file mode 100644
index 0000000..4eef3b4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_30b0b0 "textureStore_30b0b0"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_30b0b0 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_30b0b0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_30b0b0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_30b0b0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.wgsl
new file mode 100644
index 0000000..158559f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureStore_30b0b0() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_30b0b0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_30b0b0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_30b0b0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl
new file mode 100644
index 0000000..4119114
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16uint, write>, coords: vec2<u32>, array_index: i32, value: vec4<u32>)
+fn textureStore_33cec0() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_33cec0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_33cec0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_33cec0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..86c488b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_33cec0() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_33cec0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_33cec0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_33cec0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..86c488b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_33cec0() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_33cec0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_33cec0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_33cec0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.glsl
new file mode 100644
index 0000000..26fe35d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_33cec0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_33cec0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_33cec0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_33cec0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_33cec0() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_33cec0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.msl
new file mode 100644
index 0000000..0f73a0c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_33cec0(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_33cec0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_33cec0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_33cec0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.spvasm
new file mode 100644
index 0000000..b62536b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_33cec0 "textureStore_33cec0"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_33cec0 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_33cec0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_33cec0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_33cec0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.wgsl
new file mode 100644
index 0000000..5ee34fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureStore_33cec0() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_33cec0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_33cec0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_33cec0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl
new file mode 100644
index 0000000..f8299a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32float, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_37ffd4() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37ffd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37ffd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37ffd4();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7bafb82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37ffd4() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37ffd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37ffd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37ffd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7bafb82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37ffd4() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37ffd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37ffd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37ffd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.glsl
new file mode 100644
index 0000000..1c7cfb6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_37ffd4() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_37ffd4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_37ffd4() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_37ffd4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_37ffd4() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_37ffd4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.msl
new file mode 100644
index 0000000..85bb75c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_37ffd4(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_37ffd4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_37ffd4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_37ffd4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.spvasm
new file mode 100644
index 0000000..b865d9c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_37ffd4 "textureStore_37ffd4"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_37ffd4 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_37ffd4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_37ffd4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_37ffd4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.wgsl
new file mode 100644
index 0000000..1142990
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureStore_37ffd4() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37ffd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37ffd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37ffd4();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl
new file mode 100644
index 0000000..1cd12d9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16float, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_44daa7() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_44daa7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_44daa7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_44daa7();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..987f074
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_44daa7() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_44daa7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_44daa7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_44daa7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..987f074
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_44daa7() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_44daa7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_44daa7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_44daa7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.glsl
new file mode 100644
index 0000000..a45332f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_44daa7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_44daa7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_44daa7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_44daa7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_44daa7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_44daa7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.msl
new file mode 100644
index 0000000..65604af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_44daa7(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_44daa7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_44daa7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_44daa7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a6ccca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_44daa7 "textureStore_44daa7"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_44daa7 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_44daa7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_44daa7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_44daa7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.wgsl
new file mode 100644
index 0000000..1deb175
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureStore_44daa7() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_44daa7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_44daa7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_44daa7();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl
new file mode 100644
index 0000000..f239e4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32uint, write>, coords: vec2<u32>, array_index: i32, value: vec4<u32>)
+fn textureStore_4d359d() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_4d359d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_4d359d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_4d359d();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..39ad70a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_4d359d() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_4d359d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_4d359d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_4d359d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..39ad70a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_4d359d() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_4d359d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_4d359d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_4d359d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl
new file mode 100644
index 0000000..b1e3929
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_4d359d() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_4d359d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_4d359d() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_4d359d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_4d359d() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_4d359d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.msl
new file mode 100644
index 0000000..db817af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_4d359d(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_4d359d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_4d359d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_4d359d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.spvasm
new file mode 100644
index 0000000..a218220
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_4d359d "textureStore_4d359d"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_4d359d = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_4d359d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_4d359d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_4d359d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.wgsl
new file mode 100644
index 0000000..aeeef6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureStore_4d359d() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_4d359d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_4d359d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_4d359d();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl
new file mode 100644
index 0000000..482beb0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8snorm, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_59a0ab() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_59a0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_59a0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_59a0ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1a0d898
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_59a0ab() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_59a0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_59a0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_59a0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1a0d898
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_59a0ab() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_59a0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_59a0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_59a0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.glsl
new file mode 100644
index 0000000..d89b2c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_59a0ab() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_59a0ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_59a0ab() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_59a0ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureStore_59a0ab() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_59a0ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.msl
new file mode 100644
index 0000000..b77b7dd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_59a0ab(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_59a0ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_59a0ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_59a0ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..d2ecfac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_59a0ab "textureStore_59a0ab"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_59a0ab = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_59a0ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_59a0ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_59a0ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..2b2d44c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureStore_59a0ab() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_59a0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_59a0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_59a0ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl
new file mode 100644
index 0000000..9b84f6d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8sint, write>, coords: vec2<i32>, array_index: u32, value: vec4<i32>)
+fn textureStore_5ddc61() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_5ddc61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_5ddc61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_5ddc61();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e916cf9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_5ddc61() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_5ddc61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_5ddc61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_5ddc61();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e916cf9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_5ddc61() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_5ddc61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_5ddc61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_5ddc61();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.glsl
new file mode 100644
index 0000000..a94cc1a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_5ddc61() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_5ddc61();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_5ddc61() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_5ddc61();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_5ddc61() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_5ddc61();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.msl
new file mode 100644
index 0000000..e8b62ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_5ddc61(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_5ddc61(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_5ddc61(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_5ddc61(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.spvasm
new file mode 100644
index 0000000..68f61b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_5ddc61 "textureStore_5ddc61"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_5ddc61 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_5ddc61
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_5ddc61
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_5ddc61
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.wgsl
new file mode 100644
index 0000000..de8f621
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureStore_5ddc61() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_5ddc61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_5ddc61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_5ddc61();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl
new file mode 100644
index 0000000..92689e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32float, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_658a74() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_658a74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_658a74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_658a74();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d3dcb5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_658a74() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_658a74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_658a74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_658a74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d3dcb5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_658a74() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_658a74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_658a74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_658a74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl
new file mode 100644
index 0000000..0724c65
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_658a74() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_658a74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_658a74() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_658a74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_658a74() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_658a74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.msl
new file mode 100644
index 0000000..0921ddc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_658a74(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_658a74(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_658a74(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_658a74(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.spvasm
new file mode 100644
index 0000000..5607331
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_658a74 "textureStore_658a74"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_658a74 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_658a74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_658a74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_658a74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.wgsl
new file mode 100644
index 0000000..9c8cc3a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureStore_658a74() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_658a74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_658a74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_658a74();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl
new file mode 100644
index 0000000..b909a03
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba32uint, write>, coords: vec2<u32>, array_index: i32, value: vec4<u32>)
+fn textureStore_6f8642() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f8642();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f8642();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f8642();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..61a68cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_6f8642() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f8642();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f8642();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f8642();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..61a68cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_6f8642() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f8642();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f8642();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f8642();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.glsl
new file mode 100644
index 0000000..9471f9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_6f8642() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_6f8642();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_6f8642() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_6f8642();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_6f8642() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_6f8642();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.msl
new file mode 100644
index 0000000..233e519
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6f8642(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_6f8642(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_6f8642(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_6f8642(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.spvasm
new file mode 100644
index 0000000..2ce57c6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6f8642 "textureStore_6f8642"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_6f8642 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_6f8642
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_6f8642
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_6f8642
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.wgsl
new file mode 100644
index 0000000..631e3c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureStore_6f8642() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f8642();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f8642();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f8642();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl
new file mode 100644
index 0000000..93ebb93
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32sint, write>, coords: vec2<u32>, array_index: i32, value: vec4<i32>)
+fn textureStore_72fa64() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_72fa64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_72fa64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_72fa64();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..86c2bf4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_72fa64() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_72fa64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_72fa64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_72fa64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..86c2bf4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_72fa64() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_72fa64();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_72fa64();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_72fa64();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl
new file mode 100644
index 0000000..9b394c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_72fa64() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_72fa64();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_72fa64() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_72fa64();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_72fa64() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_72fa64();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.msl
new file mode 100644
index 0000000..a9d5d54
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_72fa64(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_72fa64(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_72fa64(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_72fa64(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.spvasm
new file mode 100644
index 0000000..4b421e0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_72fa64 "textureStore_72fa64"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_72fa64 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_72fa64
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_72fa64
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_72fa64
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.wgsl
new file mode 100644
index 0000000..cb9be28
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureStore_72fa64() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_72fa64();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_72fa64();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_72fa64();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl
new file mode 100644
index 0000000..dd6f0c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32sint, write>, coords: vec2<i32>, array_index: u32, value: vec4<i32>)
+fn textureStore_7bb211() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_7bb211();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_7bb211();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_7bb211();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b1a3e77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_7bb211() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_7bb211();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_7bb211();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_7bb211();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b1a3e77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_7bb211() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_7bb211();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_7bb211();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_7bb211();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl
new file mode 100644
index 0000000..12f9790
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_7bb211() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_7bb211();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_7bb211() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_7bb211();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_7bb211() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_7bb211();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.msl
new file mode 100644
index 0000000..54eca42
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_7bb211(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_7bb211(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_7bb211(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_7bb211(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.spvasm
new file mode 100644
index 0000000..fde30d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_7bb211 "textureStore_7bb211"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_7bb211 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_7bb211
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_7bb211
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_7bb211
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.wgsl
new file mode 100644
index 0000000..99a7440
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureStore_7bb211() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_7bb211();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_7bb211();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_7bb211();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl
new file mode 100644
index 0000000..eca69e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32uint, write>, coords: vec2<i32>, array_index: u32, value: vec4<u32>)
+fn textureStore_8ff674() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8ff674();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8ff674();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8ff674();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..478e857
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_8ff674() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8ff674();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8ff674();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8ff674();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..478e857
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_8ff674() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8ff674();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8ff674();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8ff674();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.glsl
new file mode 100644
index 0000000..dc5d86b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_8ff674() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_8ff674();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_8ff674() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_8ff674();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_8ff674() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_8ff674();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.msl
new file mode 100644
index 0000000..ae3354e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_8ff674(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_8ff674(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_8ff674(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_8ff674(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.spvasm
new file mode 100644
index 0000000..d97d70a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_8ff674 "textureStore_8ff674"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_8ff674 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_8ff674
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_8ff674
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_8ff674
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.wgsl
new file mode 100644
index 0000000..b313be4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureStore_8ff674() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8ff674();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8ff674();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8ff674();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl
new file mode 100644
index 0000000..6992b60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32sint, write>, coords: vec2<i32>, array_index: u32, value: vec4<i32>)
+fn textureStore_9938b7() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9938b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9938b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9938b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1a75432
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_9938b7() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9938b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9938b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9938b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1a75432
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_9938b7() {
+ arg_0[int3(0, 0, int(1u))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9938b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9938b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9938b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.glsl
new file mode 100644
index 0000000..e448b68
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_9938b7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_9938b7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_9938b7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_9938b7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_9938b7() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_9938b7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.msl
new file mode 100644
index 0000000..5e76a03
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9938b7(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_9938b7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_9938b7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_9938b7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.spvasm
new file mode 100644
index 0000000..265968a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9938b7 "textureStore_9938b7"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_9938b7 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_9938b7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_9938b7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_9938b7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.wgsl
new file mode 100644
index 0000000..ed0775f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureStore_9938b7() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9938b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9938b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9938b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl
new file mode 100644
index 0000000..805fbf2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8unorm, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_9d8668() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9d8668();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9d8668();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9d8668();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..29f00cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_9d8668() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9d8668();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9d8668();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9d8668();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..29f00cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_9d8668() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9d8668();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9d8668();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9d8668();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.glsl
new file mode 100644
index 0000000..bb433ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_9d8668() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_9d8668();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_9d8668() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_9d8668();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureStore_9d8668() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_9d8668();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.msl
new file mode 100644
index 0000000..83778bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9d8668(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_9d8668(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_9d8668(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_9d8668(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.spvasm
new file mode 100644
index 0000000..7c36c49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9d8668 "textureStore_9d8668"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_9d8668 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_9d8668
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_9d8668
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_9d8668
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.wgsl
new file mode 100644
index 0000000..8f30157
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureStore_9d8668() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9d8668();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9d8668();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9d8668();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl
new file mode 100644
index 0000000..a100c70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8uint, write>, coords: vec2<i32>, array_index: u32, value: vec4<u32>)
+fn textureStore_9f7cea() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9f7cea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9f7cea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9f7cea();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dfb1462
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_9f7cea() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9f7cea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9f7cea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9f7cea();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dfb1462
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_9f7cea() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9f7cea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9f7cea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9f7cea();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.glsl
new file mode 100644
index 0000000..4639026
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_9f7cea() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_9f7cea();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_9f7cea() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_9f7cea();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_9f7cea() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_9f7cea();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.msl
new file mode 100644
index 0000000..6ebb568
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9f7cea(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_9f7cea(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_9f7cea(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_9f7cea(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.spvasm
new file mode 100644
index 0000000..09b1bdd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9f7cea "textureStore_9f7cea"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_9f7cea = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_9f7cea
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_9f7cea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_9f7cea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.wgsl
new file mode 100644
index 0000000..2cfc03b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureStore_9f7cea() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9f7cea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9f7cea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9f7cea();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl
new file mode 100644
index 0000000..8bbdda2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16float, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_a6a986() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a6a986();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a6a986();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a6a986();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7129e59
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_a6a986() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a6a986();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a6a986();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a6a986();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7129e59
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_a6a986() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a6a986();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a6a986();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a6a986();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.glsl
new file mode 100644
index 0000000..0d9db4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_a6a986() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_a6a986();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_a6a986() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_a6a986();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureStore_a6a986() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_a6a986();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.msl
new file mode 100644
index 0000000..ecbe6c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_a6a986(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_a6a986(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_a6a986(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_a6a986(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.spvasm
new file mode 100644
index 0000000..08a3859
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_a6a986 "textureStore_a6a986"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_a6a986 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_a6a986
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_a6a986
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_a6a986
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.wgsl
new file mode 100644
index 0000000..a07b3a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureStore_a6a986() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a6a986();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a6a986();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a6a986();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl
new file mode 100644
index 0000000..ad57368
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba8sint, write>, coords: vec2<u32>, array_index: i32, value: vec4<i32>)
+fn textureStore_c32905() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_c32905();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_c32905();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_c32905();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8bb2be1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_c32905() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_c32905();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_c32905();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_c32905();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8bb2be1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_c32905() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_c32905();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_c32905();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_c32905();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.glsl
new file mode 100644
index 0000000..1992aea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_c32905() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+vec4 vertex_main() {
+ textureStore_c32905();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_c32905() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void fragment_main() {
+ textureStore_c32905();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureStore_c32905() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), ivec4(0));
+}
+
+void compute_main() {
+ textureStore_c32905();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.msl
new file mode 100644
index 0000000..5365b9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_c32905(texture2d_array<int, access::write> tint_symbol_1) {
+ tint_symbol_1.write(int4(0), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureStore_c32905(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_c32905(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_c32905(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.spvasm
new file mode 100644
index 0000000..81e223f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_c32905 "textureStore_c32905"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_c32905 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_c32905
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_c32905
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_c32905
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f62744
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureStore_c32905() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<i32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_c32905();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_c32905();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_c32905();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl
new file mode 100644
index 0000000..4477682
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32float, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_d55e65() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_d55e65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_d55e65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_d55e65();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2da0b0d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_d55e65() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_d55e65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_d55e65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_d55e65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2da0b0d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_d55e65() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_d55e65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_d55e65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_d55e65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.glsl
new file mode 100644
index 0000000..a13f035
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_d55e65() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_d55e65();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_d55e65() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_d55e65();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_d55e65() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_d55e65();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.msl
new file mode 100644
index 0000000..2ba46c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_d55e65(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_d55e65(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_d55e65(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_d55e65(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.spvasm
new file mode 100644
index 0000000..6a858f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_d55e65 "textureStore_d55e65"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_d55e65 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_d55e65
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_d55e65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_d55e65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.wgsl
new file mode 100644
index 0000000..75e91b5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureStore_d55e65() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_d55e65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_d55e65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_d55e65();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl
new file mode 100644
index 0000000..437f7f2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r32float, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_df2ca4() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_df2ca4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_df2ca4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_df2ca4();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..baf4f2f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_df2ca4() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_df2ca4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_df2ca4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_df2ca4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..baf4f2f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_df2ca4() {
+ arg_0[int3(0, 0, int(1u))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_df2ca4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_df2ca4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_df2ca4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.glsl
new file mode 100644
index 0000000..eea8131
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_df2ca4() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_df2ca4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_df2ca4() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_df2ca4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_df2ca4() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_df2ca4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.msl
new file mode 100644
index 0000000..00b2bb9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_df2ca4(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_df2ca4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_df2ca4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_df2ca4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.spvasm
new file mode 100644
index 0000000..401fcfb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_df2ca4 "textureStore_df2ca4"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_df2ca4 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_df2ca4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_df2ca4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_df2ca4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.wgsl
new file mode 100644
index 0000000..a70a6fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureStore_df2ca4() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_df2ca4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_df2ca4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_df2ca4();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl
new file mode 100644
index 0000000..5f998f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32float, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_dfa9a1() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_dfa9a1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_dfa9a1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_dfa9a1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2e48f79
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_dfa9a1() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_dfa9a1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_dfa9a1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dfa9a1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2e48f79
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_dfa9a1() {
+ arg_0[uint3(0u, 0u, uint(1))] = (0.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_dfa9a1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_dfa9a1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dfa9a1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl
new file mode 100644
index 0000000..abd5457
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_dfa9a1() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_dfa9a1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_dfa9a1() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void fragment_main() {
+ textureStore_dfa9a1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureStore_dfa9a1() {
+ imageStore(arg_0, ivec3(uvec3(0u, 0u, uint(1))), vec4(0.0f));
+}
+
+void compute_main() {
+ textureStore_dfa9a1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.msl
new file mode 100644
index 0000000..22747d5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_dfa9a1(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(0.0f), uint2(uint2(0u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_dfa9a1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_dfa9a1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_dfa9a1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1ab8b71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_dfa9a1 "textureStore_dfa9a1"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_0 = OpConstant %uint 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_dfa9a1 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %21 = OpBitcast %uint %int_1
+ %24 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %21
+ OpImageWrite %17 %24 %5
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_dfa9a1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_dfa9a1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_dfa9a1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.wgsl
new file mode 100644
index 0000000..a930131
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureStore_dfa9a1() {
+ textureStore(arg_0, vec2<u32>(), 1i, vec4<f32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_dfa9a1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_dfa9a1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_dfa9a1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl
new file mode 100644
index 0000000..9621682
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rg32uint, write>, coords: vec2<i32>, array_index: u32, value: vec4<u32>)
+fn textureStore_dffb13() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_dffb13();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_dffb13();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_dffb13();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..84db8e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_dffb13() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_dffb13();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_dffb13();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dffb13();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..84db8e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_dffb13() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_dffb13();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_dffb13();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dffb13();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl
new file mode 100644
index 0000000..1f48bf2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_dffb13() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_dffb13();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_dffb13() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_dffb13();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_dffb13() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_dffb13();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.msl
new file mode 100644
index 0000000..65218a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_dffb13(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_dffb13(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_dffb13(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_dffb13(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.spvasm
new file mode 100644
index 0000000..8df8e48
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_dffb13 "textureStore_dffb13"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_dffb13 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_dffb13
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_dffb13
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_dffb13
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.wgsl
new file mode 100644
index 0000000..b7fb947
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureStore_dffb13() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_dffb13();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_dffb13();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_dffb13();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl
new file mode 100644
index 0000000..abcaea1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<rgba16uint, write>, coords: vec2<i32>, array_index: u32, value: vec4<u32>)
+fn textureStore_fd350c() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_fd350c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_fd350c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_fd350c();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..30f1481
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_fd350c() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_fd350c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_fd350c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_fd350c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..30f1481
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_fd350c() {
+ arg_0[int3(0, 0, int(1u))] = (0u).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_fd350c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_fd350c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_fd350c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.glsl
new file mode 100644
index 0000000..1996d04
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_fd350c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+vec4 vertex_main() {
+ textureStore_fd350c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_fd350c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void fragment_main() {
+ textureStore_fd350c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureStore_fd350c() {
+ imageStore(arg_0, ivec3(0, 0, int(1u)), uvec4(0u));
+}
+
+void compute_main() {
+ textureStore_fd350c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.msl
new file mode 100644
index 0000000..f77d524
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_fd350c(texture2d_array<uint, access::write> tint_symbol_1) {
+ tint_symbol_1.write(uint4(0u), uint2(int2(0)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureStore_fd350c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_fd350c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_fd350c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c156ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_fd350c "textureStore_fd350c"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+ %uint_1 = OpConstant %uint 1
+ %v4uint = OpTypeVector %uint 4
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_fd350c = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %11 %arg_0
+ %22 = OpBitcast %int %uint_1
+ %24 = OpCompositeConstruct %v3int %int_0 %int_0 %22
+ OpImageWrite %18 %24 %26
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_fd350c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_fd350c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_fd350c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.wgsl
new file mode 100644
index 0000000..a880810
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureStore_fd350c() {
+ textureStore(arg_0, vec2<i32>(), 1u, vec4<u32>());
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_fd350c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_fd350c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_fd350c();
+}