[tools]: Generate intrinisic test cases
Add test/intrinsics/intrinsics.wgsl.tmpl that generates a vast set of intrinsic overload permutations into test/intrinsics/gen/...
Add expected output for all of these, including 'SKIP' headers for those that currently fail.
Fixed: tint:832
Change-Id: Id6888df52c07f35e7a55199f2ad4d842c6e2595c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53051
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
diff --git a/test/intrinsics/gen/abs/002533.wgsl b/test/intrinsics/gen/abs/002533.wgsl
new file mode 100644
index 0000000..26a968f
--- /dev/null
+++ b/test/intrinsics/gen/abs/002533.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_002533() {
+ var res: vec4<f32> = abs(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_002533();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_002533();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_002533();
+}
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl
new file mode 100644
index 0000000..63a8d67
--- /dev/null
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_002533() {
+ float4 res = abs(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ abs_002533();
+ return;
+}
+
+void fragment_main() {
+ abs_002533();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_002533();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.msl b/test/intrinsics/gen/abs/002533.wgsl.expected.msl
new file mode 100644
index 0000000..15940e8
--- /dev/null
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_002533() {
+ float4 res = fabs(float4());
+}
+
+vertex void vertex_main() {
+ abs_002533();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_002533();
+ return;
+}
+
+kernel void compute_main() {
+ abs_002533();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm
new file mode 100644
index 0000000..90cbf83
--- /dev/null
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_002533 "abs_002533"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %abs_002533 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 FAbs %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %abs_002533
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %abs_002533
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %abs_002533
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl
new file mode 100644
index 0000000..480a9de
--- /dev/null
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_002533() {
+ var res : vec4<f32> = abs(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_002533();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_002533();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_002533();
+}
diff --git a/test/intrinsics/gen/abs/005174.wgsl b/test/intrinsics/gen/abs/005174.wgsl
new file mode 100644
index 0000000..7384a15
--- /dev/null
+++ b/test/intrinsics/gen/abs/005174.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_005174() {
+ var res: vec3<f32> = abs(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_005174();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_005174();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_005174();
+}
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl
new file mode 100644
index 0000000..2733aae
--- /dev/null
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_005174() {
+ float3 res = abs(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ abs_005174();
+ return;
+}
+
+void fragment_main() {
+ abs_005174();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_005174();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.msl b/test/intrinsics/gen/abs/005174.wgsl.expected.msl
new file mode 100644
index 0000000..333bdca
--- /dev/null
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_005174() {
+ float3 res = fabs(float3());
+}
+
+vertex void vertex_main() {
+ abs_005174();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_005174();
+ return;
+}
+
+kernel void compute_main() {
+ abs_005174();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm
new file mode 100644
index 0000000..3c4c075
--- /dev/null
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_005174 "abs_005174"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %abs_005174 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 FAbs %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %abs_005174
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %abs_005174
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %abs_005174
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl
new file mode 100644
index 0000000..0d0cb37
--- /dev/null
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_005174() {
+ var res : vec3<f32> = abs(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_005174();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_005174();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_005174();
+}
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl
new file mode 100644
index 0000000..bc53763
--- /dev/null
+++ b/test/intrinsics/gen/abs/1ce782.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_1ce782() {
+ var res: vec4<u32> = abs(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_1ce782();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_1ce782();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_1ce782();
+}
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl
new file mode 100644
index 0000000..dc858cb
--- /dev/null
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_1ce782() {
+ uint4 res = abs(uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ abs_1ce782();
+ return;
+}
+
+void fragment_main() {
+ abs_1ce782();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_1ce782();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl
new file mode 100644
index 0000000..5f35a13
--- /dev/null
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_1ce782() {
+ uint4 res = abs(uint4());
+}
+
+vertex void vertex_main() {
+ abs_1ce782();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_1ce782();
+ return;
+}
+
+kernel void compute_main() {
+ abs_1ce782();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm
new file mode 100644
index 0000000..d791e62
--- /dev/null
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_1ce782 "abs_1ce782"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %13 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+ %abs_1ce782 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %13
+ %9 = OpExtInst %v4uint %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_1ce782
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_1ce782
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_1ce782
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl
new file mode 100644
index 0000000..5bf8abe
--- /dev/null
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_1ce782() {
+ var res : vec4<u32> = abs(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_1ce782();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_1ce782();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_1ce782();
+}
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl
new file mode 100644
index 0000000..4ad1136
--- /dev/null
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_1e9d53() {
+ var res: vec2<f32> = abs(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_1e9d53();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_1e9d53();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_1e9d53();
+}
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl
new file mode 100644
index 0000000..5c0e701
--- /dev/null
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_1e9d53() {
+ float2 res = abs(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ abs_1e9d53();
+ return;
+}
+
+void fragment_main() {
+ abs_1e9d53();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_1e9d53();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl
new file mode 100644
index 0000000..f126e82
--- /dev/null
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_1e9d53() {
+ float2 res = fabs(float2());
+}
+
+vertex void vertex_main() {
+ abs_1e9d53();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_1e9d53();
+ return;
+}
+
+kernel void compute_main() {
+ abs_1e9d53();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm
new file mode 100644
index 0000000..815fcf9
--- /dev/null
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_1e9d53 "abs_1e9d53"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %abs_1e9d53 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 FAbs %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %abs_1e9d53
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %abs_1e9d53
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %abs_1e9d53
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl
new file mode 100644
index 0000000..1e51a1f
--- /dev/null
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_1e9d53() {
+ var res : vec2<f32> = abs(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_1e9d53();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_1e9d53();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_1e9d53();
+}
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl
new file mode 100644
index 0000000..422ee72
--- /dev/null
+++ b/test/intrinsics/gen/abs/467cd1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_467cd1() {
+ var res: u32 = abs(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_467cd1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_467cd1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_467cd1();
+}
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl
new file mode 100644
index 0000000..0728dea
--- /dev/null
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_467cd1() {
+ uint res = abs(1u);
+}
+
+void vertex_main() {
+ abs_467cd1();
+ return;
+}
+
+void fragment_main() {
+ abs_467cd1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_467cd1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl
new file mode 100644
index 0000000..63d83b3
--- /dev/null
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_467cd1() {
+ uint res = abs(1u);
+}
+
+vertex void vertex_main() {
+ abs_467cd1();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_467cd1();
+ return;
+}
+
+kernel void compute_main() {
+ abs_467cd1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm
new file mode 100644
index 0000000..7af5b05
--- /dev/null
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_467cd1 "abs_467cd1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %15 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %abs_467cd1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %15
+ %9 = OpExtInst %uint %11 SAbs %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_467cd1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_467cd1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_467cd1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl
new file mode 100644
index 0000000..b40916d
--- /dev/null
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_467cd1() {
+ var res : u32 = abs(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_467cd1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_467cd1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_467cd1();
+}
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl
new file mode 100644
index 0000000..0105439
--- /dev/null
+++ b/test/intrinsics/gen/abs/4ad288.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_4ad288() {
+ var res: i32 = abs(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_4ad288();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_4ad288();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_4ad288();
+}
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl
new file mode 100644
index 0000000..e7ff244
--- /dev/null
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_4ad288() {
+ int res = abs(1);
+}
+
+void vertex_main() {
+ abs_4ad288();
+ return;
+}
+
+void fragment_main() {
+ abs_4ad288();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_4ad288();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl
new file mode 100644
index 0000000..c454219
--- /dev/null
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_4ad288() {
+ int res = abs(1);
+}
+
+vertex void vertex_main() {
+ abs_4ad288();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_4ad288();
+ return;
+}
+
+kernel void compute_main() {
+ abs_4ad288();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm
new file mode 100644
index 0000000..bb37f07
--- /dev/null
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_4ad288 "abs_4ad288"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %15 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %abs_4ad288 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %15
+ %9 = OpExtInst %int %11 SAbs %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_4ad288
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_4ad288
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_4ad288
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl
new file mode 100644
index 0000000..2842caf
--- /dev/null
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_4ad288() {
+ var res : i32 = abs(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_4ad288();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_4ad288();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_4ad288();
+}
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl
new file mode 100644
index 0000000..5b305f8
--- /dev/null
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_5ad50a() {
+ var res: vec3<i32> = abs(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_5ad50a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_5ad50a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_5ad50a();
+}
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl
new file mode 100644
index 0000000..075e3cf
--- /dev/null
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_5ad50a() {
+ int3 res = abs(int3(0, 0, 0));
+}
+
+void vertex_main() {
+ abs_5ad50a();
+ return;
+}
+
+void fragment_main() {
+ abs_5ad50a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_5ad50a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl
new file mode 100644
index 0000000..2d542b8
--- /dev/null
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_5ad50a() {
+ int3 res = abs(int3());
+}
+
+vertex void vertex_main() {
+ abs_5ad50a();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_5ad50a();
+ return;
+}
+
+kernel void compute_main() {
+ abs_5ad50a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm
new file mode 100644
index 0000000..3419005
--- /dev/null
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_5ad50a "abs_5ad50a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %13 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+ %abs_5ad50a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %13
+ %9 = OpExtInst %v3int %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_5ad50a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_5ad50a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_5ad50a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl
new file mode 100644
index 0000000..ec7efb6
--- /dev/null
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_5ad50a() {
+ var res : vec3<i32> = abs(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_5ad50a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_5ad50a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_5ad50a();
+}
diff --git a/test/intrinsics/gen/abs/7326de.wgsl b/test/intrinsics/gen/abs/7326de.wgsl
new file mode 100644
index 0000000..d32d55f
--- /dev/null
+++ b/test/intrinsics/gen/abs/7326de.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_7326de() {
+ var res: vec3<u32> = abs(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7326de();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7326de();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7326de();
+}
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl
new file mode 100644
index 0000000..1452464
--- /dev/null
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_7326de() {
+ uint3 res = abs(uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ abs_7326de();
+ return;
+}
+
+void fragment_main() {
+ abs_7326de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_7326de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl
new file mode 100644
index 0000000..9c2eb81
--- /dev/null
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_7326de() {
+ uint3 res = abs(uint3());
+}
+
+vertex void vertex_main() {
+ abs_7326de();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_7326de();
+ return;
+}
+
+kernel void compute_main() {
+ abs_7326de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm
new file mode 100644
index 0000000..55422b3
--- /dev/null
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_7326de "abs_7326de"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %13 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+ %abs_7326de = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %13
+ %9 = OpExtInst %v3uint %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_7326de
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_7326de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_7326de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl
new file mode 100644
index 0000000..0cd0f3c
--- /dev/null
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_7326de() {
+ var res : vec3<u32> = abs(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7326de();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7326de();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7326de();
+}
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl
new file mode 100644
index 0000000..60f0174
--- /dev/null
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_7f28e6() {
+ var res: vec2<u32> = abs(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7f28e6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7f28e6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7f28e6();
+}
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl
new file mode 100644
index 0000000..c2394da
--- /dev/null
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_7f28e6() {
+ uint2 res = abs(uint2(0u, 0u));
+}
+
+void vertex_main() {
+ abs_7f28e6();
+ return;
+}
+
+void fragment_main() {
+ abs_7f28e6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_7f28e6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl
new file mode 100644
index 0000000..9ec6060
--- /dev/null
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_7f28e6() {
+ uint2 res = abs(uint2());
+}
+
+vertex void vertex_main() {
+ abs_7f28e6();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_7f28e6();
+ return;
+}
+
+kernel void compute_main() {
+ abs_7f28e6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm
new file mode 100644
index 0000000..b3cffe1
--- /dev/null
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_7f28e6 "abs_7f28e6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %13 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+ %abs_7f28e6 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %13
+ %9 = OpExtInst %v2uint %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_7f28e6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_7f28e6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_7f28e6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl
new file mode 100644
index 0000000..53a7554
--- /dev/null
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_7f28e6() {
+ var res : vec2<u32> = abs(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7f28e6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7f28e6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7f28e6();
+}
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl
new file mode 100644
index 0000000..c676477
--- /dev/null
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_7faa9e() {
+ var res: vec2<i32> = abs(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7faa9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7faa9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7faa9e();
+}
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl
new file mode 100644
index 0000000..80607a0
--- /dev/null
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_7faa9e() {
+ int2 res = abs(int2(0, 0));
+}
+
+void vertex_main() {
+ abs_7faa9e();
+ return;
+}
+
+void fragment_main() {
+ abs_7faa9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_7faa9e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl
new file mode 100644
index 0000000..9b60918
--- /dev/null
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_7faa9e() {
+ int2 res = abs(int2());
+}
+
+vertex void vertex_main() {
+ abs_7faa9e();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_7faa9e();
+ return;
+}
+
+kernel void compute_main() {
+ abs_7faa9e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..76f9674
--- /dev/null
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_7faa9e "abs_7faa9e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %13 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+ %abs_7faa9e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %13
+ %9 = OpExtInst %v2int %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_7faa9e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_7faa9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_7faa9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2f73f6
--- /dev/null
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_7faa9e() {
+ var res : vec2<i32> = abs(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_7faa9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_7faa9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_7faa9e();
+}
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl
new file mode 100644
index 0000000..05e66e2
--- /dev/null
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_9c80a6() {
+ var res: vec4<i32> = abs(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_9c80a6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_9c80a6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_9c80a6();
+}
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl
new file mode 100644
index 0000000..fb08cab
--- /dev/null
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_9c80a6() {
+ int4 res = abs(int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ abs_9c80a6();
+ return;
+}
+
+void fragment_main() {
+ abs_9c80a6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_9c80a6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl
new file mode 100644
index 0000000..26f8447
--- /dev/null
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_9c80a6() {
+ int4 res = abs(int4());
+}
+
+vertex void vertex_main() {
+ abs_9c80a6();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_9c80a6();
+ return;
+}
+
+kernel void compute_main() {
+ abs_9c80a6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm
new file mode 100644
index 0000000..c3806ce
--- /dev/null
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_9c80a6 "abs_9c80a6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %13 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+ %abs_9c80a6 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %13
+ %9 = OpExtInst %v4int %12 SAbs %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %abs_9c80a6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_9c80a6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %abs_9c80a6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl
new file mode 100644
index 0000000..797774c
--- /dev/null
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_9c80a6() {
+ var res : vec4<i32> = abs(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_9c80a6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_9c80a6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_9c80a6();
+}
diff --git a/test/intrinsics/gen/abs/b96037.wgsl b/test/intrinsics/gen/abs/b96037.wgsl
new file mode 100644
index 0000000..cd0e431
--- /dev/null
+++ b/test/intrinsics/gen/abs/b96037.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn abs_b96037() {
+ var res: f32 = abs(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_b96037();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_b96037();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_b96037();
+}
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl
new file mode 100644
index 0000000..655840a
--- /dev/null
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void abs_b96037() {
+ float res = abs(1.0f);
+}
+
+void vertex_main() {
+ abs_b96037();
+ return;
+}
+
+void fragment_main() {
+ abs_b96037();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ abs_b96037();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl
new file mode 100644
index 0000000..f2db329
--- /dev/null
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void abs_b96037() {
+ float res = fabs(1.0f);
+}
+
+vertex void vertex_main() {
+ abs_b96037();
+ return;
+}
+
+fragment void fragment_main() {
+ abs_b96037();
+ return;
+}
+
+kernel void compute_main() {
+ abs_b96037();
+ return;
+}
+
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm
new file mode 100644
index 0000000..af85239
--- /dev/null
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %abs_b96037 "abs_b96037"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %abs_b96037 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 FAbs %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %abs_b96037
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %abs_b96037
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %abs_b96037
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl
new file mode 100644
index 0000000..112c0a1
--- /dev/null
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn abs_b96037() {
+ var res : f32 = abs(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ abs_b96037();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ abs_b96037();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ abs_b96037();
+}
diff --git a/test/intrinsics/gen/acos/489247.wgsl b/test/intrinsics/gen/acos/489247.wgsl
new file mode 100644
index 0000000..091f732
--- /dev/null
+++ b/test/intrinsics/gen/acos/489247.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn acos_489247() {
+ var res: f32 = acos(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_489247();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_489247();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_489247();
+}
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl
new file mode 100644
index 0000000..f5c0610
--- /dev/null
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void acos_489247() {
+ float res = acos(1.0f);
+}
+
+void vertex_main() {
+ acos_489247();
+ return;
+}
+
+void fragment_main() {
+ acos_489247();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ acos_489247();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.msl b/test/intrinsics/gen/acos/489247.wgsl.expected.msl
new file mode 100644
index 0000000..1f9a49d
--- /dev/null
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void acos_489247() {
+ float res = acos(1.0f);
+}
+
+vertex void vertex_main() {
+ acos_489247();
+ return;
+}
+
+fragment void fragment_main() {
+ acos_489247();
+ return;
+}
+
+kernel void compute_main() {
+ acos_489247();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm
new file mode 100644
index 0000000..55b3432
--- /dev/null
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %acos_489247 "acos_489247"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%acos_489247 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Acos %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %acos_489247
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %acos_489247
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %acos_489247
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl
new file mode 100644
index 0000000..4c8f3cc
--- /dev/null
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn acos_489247() {
+ var res : f32 = acos(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_489247();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_489247();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_489247();
+}
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl
new file mode 100644
index 0000000..0c15ac2
--- /dev/null
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn acos_8e2acf() {
+ var res: vec4<f32> = acos(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_8e2acf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_8e2acf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_8e2acf();
+}
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl
new file mode 100644
index 0000000..df055b2
--- /dev/null
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void acos_8e2acf() {
+ float4 res = acos(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ acos_8e2acf();
+ return;
+}
+
+void fragment_main() {
+ acos_8e2acf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ acos_8e2acf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl
new file mode 100644
index 0000000..56875a7
--- /dev/null
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void acos_8e2acf() {
+ float4 res = acos(float4());
+}
+
+vertex void vertex_main() {
+ acos_8e2acf();
+ return;
+}
+
+fragment void fragment_main() {
+ acos_8e2acf();
+ return;
+}
+
+kernel void compute_main() {
+ acos_8e2acf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b7021c
--- /dev/null
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %acos_8e2acf "acos_8e2acf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%acos_8e2acf = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Acos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %acos_8e2acf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %acos_8e2acf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %acos_8e2acf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl
new file mode 100644
index 0000000..8cce3c5
--- /dev/null
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn acos_8e2acf() {
+ var res : vec4<f32> = acos(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_8e2acf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_8e2acf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_8e2acf();
+}
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl
new file mode 100644
index 0000000..d55e6bc
--- /dev/null
+++ b/test/intrinsics/gen/acos/a610c4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn acos_a610c4() {
+ var res: vec3<f32> = acos(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_a610c4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_a610c4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_a610c4();
+}
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl
new file mode 100644
index 0000000..d30ba41
--- /dev/null
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void acos_a610c4() {
+ float3 res = acos(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ acos_a610c4();
+ return;
+}
+
+void fragment_main() {
+ acos_a610c4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ acos_a610c4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl
new file mode 100644
index 0000000..d5e7574
--- /dev/null
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void acos_a610c4() {
+ float3 res = acos(float3());
+}
+
+vertex void vertex_main() {
+ acos_a610c4();
+ return;
+}
+
+fragment void fragment_main() {
+ acos_a610c4();
+ return;
+}
+
+kernel void compute_main() {
+ acos_a610c4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm
new file mode 100644
index 0000000..1f6a492
--- /dev/null
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %acos_a610c4 "acos_a610c4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%acos_a610c4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Acos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %acos_a610c4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %acos_a610c4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %acos_a610c4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl
new file mode 100644
index 0000000..8c17039
--- /dev/null
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn acos_a610c4() {
+ var res : vec3<f32> = acos(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_a610c4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_a610c4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_a610c4();
+}
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl
new file mode 100644
index 0000000..d6962e0
--- /dev/null
+++ b/test/intrinsics/gen/acos/dfc915.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn acos_dfc915() {
+ var res: vec2<f32> = acos(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_dfc915();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_dfc915();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_dfc915();
+}
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl
new file mode 100644
index 0000000..9ae2fb0
--- /dev/null
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void acos_dfc915() {
+ float2 res = acos(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ acos_dfc915();
+ return;
+}
+
+void fragment_main() {
+ acos_dfc915();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ acos_dfc915();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl
new file mode 100644
index 0000000..f0b5e6d
--- /dev/null
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void acos_dfc915() {
+ float2 res = acos(float2());
+}
+
+vertex void vertex_main() {
+ acos_dfc915();
+ return;
+}
+
+fragment void fragment_main() {
+ acos_dfc915();
+ return;
+}
+
+kernel void compute_main() {
+ acos_dfc915();
+ return;
+}
+
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm
new file mode 100644
index 0000000..47e584d
--- /dev/null
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %acos_dfc915 "acos_dfc915"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%acos_dfc915 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Acos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %acos_dfc915
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %acos_dfc915
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %acos_dfc915
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ee1383
--- /dev/null
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn acos_dfc915() {
+ var res : vec2<f32> = acos(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ acos_dfc915();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ acos_dfc915();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ acos_dfc915();
+}
diff --git a/test/intrinsics/gen/all/986c7b.wgsl b/test/intrinsics/gen/all/986c7b.wgsl
new file mode 100644
index 0000000..ccef722
--- /dev/null
+++ b/test/intrinsics/gen/all/986c7b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn all_986c7b() {
+ var res: bool = all(vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_986c7b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_986c7b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_986c7b();
+}
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl
new file mode 100644
index 0000000..ddb983b
--- /dev/null
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void all_986c7b() {
+ bool res = all(vector<bool, 4>(false, false, false, false));
+}
+
+void vertex_main() {
+ all_986c7b();
+ return;
+}
+
+void fragment_main() {
+ all_986c7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ all_986c7b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl
new file mode 100644
index 0000000..702a365
--- /dev/null
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void all_986c7b() {
+ bool res = all(bool4());
+}
+
+vertex void vertex_main() {
+ all_986c7b();
+ return;
+}
+
+fragment void fragment_main() {
+ all_986c7b();
+ return;
+}
+
+kernel void compute_main() {
+ all_986c7b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c6a391
--- /dev/null
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %all_986c7b "all_986c7b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %12 = OpConstantNull %v4bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %all_986c7b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAll %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %all_986c7b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %all_986c7b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %all_986c7b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl
new file mode 100644
index 0000000..16db50e
--- /dev/null
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn all_986c7b() {
+ var res : bool = all(vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_986c7b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_986c7b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_986c7b();
+}
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl
new file mode 100644
index 0000000..69853b7
--- /dev/null
+++ b/test/intrinsics/gen/all/bd2dba.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn all_bd2dba() {
+ var res: bool = all(vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_bd2dba();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_bd2dba();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_bd2dba();
+}
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl
new file mode 100644
index 0000000..f49a0e7
--- /dev/null
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void all_bd2dba() {
+ bool res = all(vector<bool, 3>(false, false, false));
+}
+
+void vertex_main() {
+ all_bd2dba();
+ return;
+}
+
+void fragment_main() {
+ all_bd2dba();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ all_bd2dba();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl
new file mode 100644
index 0000000..3425ed2
--- /dev/null
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void all_bd2dba() {
+ bool res = all(bool3());
+}
+
+vertex void vertex_main() {
+ all_bd2dba();
+ return;
+}
+
+fragment void fragment_main() {
+ all_bd2dba();
+ return;
+}
+
+kernel void compute_main() {
+ all_bd2dba();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm
new file mode 100644
index 0000000..8c95c45
--- /dev/null
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %all_bd2dba "all_bd2dba"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %12 = OpConstantNull %v3bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %all_bd2dba = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAll %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %all_bd2dba
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %all_bd2dba
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %all_bd2dba
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl
new file mode 100644
index 0000000..718116c
--- /dev/null
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn all_bd2dba() {
+ var res : bool = all(vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_bd2dba();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_bd2dba();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_bd2dba();
+}
diff --git a/test/intrinsics/gen/all/f46790.wgsl b/test/intrinsics/gen/all/f46790.wgsl
new file mode 100644
index 0000000..541a718
--- /dev/null
+++ b/test/intrinsics/gen/all/f46790.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn all_f46790() {
+ var res: bool = all(vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_f46790();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_f46790();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_f46790();
+}
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl
new file mode 100644
index 0000000..6b954b6
--- /dev/null
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void all_f46790() {
+ bool res = all(vector<bool, 2>(false, false));
+}
+
+void vertex_main() {
+ all_f46790();
+ return;
+}
+
+void fragment_main() {
+ all_f46790();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ all_f46790();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.msl b/test/intrinsics/gen/all/f46790.wgsl.expected.msl
new file mode 100644
index 0000000..3c9019a
--- /dev/null
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void all_f46790() {
+ bool res = all(bool2());
+}
+
+vertex void vertex_main() {
+ all_f46790();
+ return;
+}
+
+fragment void fragment_main() {
+ all_f46790();
+ return;
+}
+
+kernel void compute_main() {
+ all_f46790();
+ return;
+}
+
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm
new file mode 100644
index 0000000..081db4a
--- /dev/null
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %all_f46790 "all_f46790"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %12 = OpConstantNull %v2bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %all_f46790 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAll %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %all_f46790
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %all_f46790
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %all_f46790
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl
new file mode 100644
index 0000000..2b156ae
--- /dev/null
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn all_f46790() {
+ var res : bool = all(vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ all_f46790();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ all_f46790();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ all_f46790();
+}
diff --git a/test/intrinsics/gen/any/083428.wgsl b/test/intrinsics/gen/any/083428.wgsl
new file mode 100644
index 0000000..9453c9c
--- /dev/null
+++ b/test/intrinsics/gen/any/083428.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn any_083428() {
+ var res: bool = any(vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_083428();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_083428();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_083428();
+}
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl
new file mode 100644
index 0000000..10dfae8
--- /dev/null
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void any_083428() {
+ bool res = any(vector<bool, 4>(false, false, false, false));
+}
+
+void vertex_main() {
+ any_083428();
+ return;
+}
+
+void fragment_main() {
+ any_083428();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ any_083428();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.msl b/test/intrinsics/gen/any/083428.wgsl.expected.msl
new file mode 100644
index 0000000..0810792
--- /dev/null
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void any_083428() {
+ bool res = any(bool4());
+}
+
+vertex void vertex_main() {
+ any_083428();
+ return;
+}
+
+fragment void fragment_main() {
+ any_083428();
+ return;
+}
+
+kernel void compute_main() {
+ any_083428();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm
new file mode 100644
index 0000000..8ed460e
--- /dev/null
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %any_083428 "any_083428"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %12 = OpConstantNull %v4bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %any_083428 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAny %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %any_083428
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %any_083428
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %any_083428
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl
new file mode 100644
index 0000000..aa9e120
--- /dev/null
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn any_083428() {
+ var res : bool = any(vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_083428();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_083428();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_083428();
+}
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl
new file mode 100644
index 0000000..16806ad
--- /dev/null
+++ b/test/intrinsics/gen/any/0e3e58.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn any_0e3e58() {
+ var res: bool = any(vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_0e3e58();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_0e3e58();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_0e3e58();
+}
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl
new file mode 100644
index 0000000..a1f2000
--- /dev/null
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void any_0e3e58() {
+ bool res = any(vector<bool, 2>(false, false));
+}
+
+void vertex_main() {
+ any_0e3e58();
+ return;
+}
+
+void fragment_main() {
+ any_0e3e58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ any_0e3e58();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl
new file mode 100644
index 0000000..b9ba7b2
--- /dev/null
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void any_0e3e58() {
+ bool res = any(bool2());
+}
+
+vertex void vertex_main() {
+ any_0e3e58();
+ return;
+}
+
+fragment void fragment_main() {
+ any_0e3e58();
+ return;
+}
+
+kernel void compute_main() {
+ any_0e3e58();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm
new file mode 100644
index 0000000..1bfea9e
--- /dev/null
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %any_0e3e58 "any_0e3e58"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %12 = OpConstantNull %v2bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %any_0e3e58 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAny %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %any_0e3e58
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %any_0e3e58
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %any_0e3e58
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl
new file mode 100644
index 0000000..7a8e246
--- /dev/null
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn any_0e3e58() {
+ var res : bool = any(vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_0e3e58();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_0e3e58();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_0e3e58();
+}
diff --git a/test/intrinsics/gen/any/e755c1.wgsl b/test/intrinsics/gen/any/e755c1.wgsl
new file mode 100644
index 0000000..e1cef53
--- /dev/null
+++ b/test/intrinsics/gen/any/e755c1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn any_e755c1() {
+ var res: bool = any(vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_e755c1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_e755c1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_e755c1();
+}
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl
new file mode 100644
index 0000000..677e6d5
--- /dev/null
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void any_e755c1() {
+ bool res = any(vector<bool, 3>(false, false, false));
+}
+
+void vertex_main() {
+ any_e755c1();
+ return;
+}
+
+void fragment_main() {
+ any_e755c1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ any_e755c1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl
new file mode 100644
index 0000000..33f9409
--- /dev/null
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void any_e755c1() {
+ bool res = any(bool3());
+}
+
+vertex void vertex_main() {
+ any_e755c1();
+ return;
+}
+
+fragment void fragment_main() {
+ any_e755c1();
+ return;
+}
+
+kernel void compute_main() {
+ any_e755c1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm
new file mode 100644
index 0000000..613d10b
--- /dev/null
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %any_e755c1 "any_e755c1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %12 = OpConstantNull %v3bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %15 = OpConstantNull %bool
+ %float_1 = OpConstant %float 1
+ %any_e755c1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %9 = OpAny %bool %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %any_e755c1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %any_e755c1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %any_e755c1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl
new file mode 100644
index 0000000..ab6f7a7
--- /dev/null
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn any_e755c1() {
+ var res : bool = any(vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ any_e755c1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ any_e755c1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ any_e755c1();
+}
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl
new file mode 100644
index 0000000..84239ad
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl
@@ -0,0 +1,47 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[block]]
+struct SB {
+ arg_0: array<u32>;
+};
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+fn arrayLength_647a40() {
+ var res: u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_647a40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_647a40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_647a40();
+}
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl
new file mode 100644
index 0000000..3d51ff4
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl
@@ -0,0 +1,26 @@
+
+ByteAddressBuffer sb : register(t0, space0);
+
+void arrayLength_647a40() {
+ uint tint_symbol_1 = 0u;
+ sb.GetDimensions(tint_symbol_1);
+ const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
+ uint res = tint_symbol_2;
+}
+
+void vertex_main() {
+ arrayLength_647a40();
+ return;
+}
+
+void fragment_main() {
+ arrayLength_647a40();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ arrayLength_647a40();
+ return;
+}
+
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl
new file mode 100644
index 0000000..1eddd1f
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl
@@ -0,0 +1,30 @@
+SKIP: FAILED
+
+
+[[block]]
+struct SB {
+ arg_0 : array<u32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_647a40() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_647a40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_647a40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_647a40();
+}
+
+Failed to generate: error: Unknown import method: arrayLength
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm
new file mode 100644
index 0000000..4f70f0b
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %SB "SB"
+ OpMemberName %SB 0 "arg_0"
+ OpName %sb "sb"
+ OpName %arrayLength_647a40 "arrayLength_647a40"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %SB Block
+ OpMemberDecorate %SB 0 Offset 0
+ OpDecorate %_runtimearr_uint ArrayStride 4
+ OpDecorate %sb NonWritable
+ OpDecorate %sb DescriptorSet 0
+ OpDecorate %sb Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+ %SB = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
+ %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %void = OpTypeVoid
+ %10 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %17 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%arrayLength_647a40 = OpFunction %void None %10
+ %13 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %17
+ %14 = OpArrayLength %uint %sb 0
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %10
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %arrayLength_647a40
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %10
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %arrayLength_647a40
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %10
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %arrayLength_647a40
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl
new file mode 100644
index 0000000..4f420f8
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+[[block]]
+struct SB {
+ arg_0 : array<u32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_647a40() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_647a40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_647a40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_647a40();
+}
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl
new file mode 100644
index 0000000..a502bf7
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl
@@ -0,0 +1,47 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[block]]
+struct SB {
+ arg_0: array<i32>;
+};
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+fn arrayLength_721c9d() {
+ var res: u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_721c9d();
+}
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl
new file mode 100644
index 0000000..e7770ff
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl
@@ -0,0 +1,26 @@
+
+ByteAddressBuffer sb : register(t0, space0);
+
+void arrayLength_721c9d() {
+ uint tint_symbol_1 = 0u;
+ sb.GetDimensions(tint_symbol_1);
+ const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
+ uint res = tint_symbol_2;
+}
+
+void vertex_main() {
+ arrayLength_721c9d();
+ return;
+}
+
+void fragment_main() {
+ arrayLength_721c9d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ arrayLength_721c9d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl
new file mode 100644
index 0000000..1620513
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl
@@ -0,0 +1,30 @@
+SKIP: FAILED
+
+
+[[block]]
+struct SB {
+ arg_0 : array<i32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_721c9d() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_721c9d();
+}
+
+Failed to generate: error: Unknown import method: arrayLength
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm
new file mode 100644
index 0000000..40294aa
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %SB "SB"
+ OpMemberName %SB 0 "arg_0"
+ OpName %sb "sb"
+ OpName %arrayLength_721c9d "arrayLength_721c9d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %SB Block
+ OpMemberDecorate %SB 0 Offset 0
+ OpDecorate %_runtimearr_int ArrayStride 4
+ OpDecorate %sb NonWritable
+ OpDecorate %sb DescriptorSet 0
+ OpDecorate %sb Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+%_runtimearr_int = OpTypeRuntimeArray %int
+ %SB = OpTypeStruct %_runtimearr_int
+%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
+ %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %void = OpTypeVoid
+ %10 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %18 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%arrayLength_721c9d = OpFunction %void None %10
+ %13 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %18
+ %14 = OpArrayLength %uint %sb 0
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %10
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %arrayLength_721c9d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %10
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %arrayLength_721c9d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %10
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %arrayLength_721c9d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl
new file mode 100644
index 0000000..57222b1
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+[[block]]
+struct SB {
+ arg_0 : array<i32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_721c9d() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_721c9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_721c9d();
+}
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl
new file mode 100644
index 0000000..87e31e0
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl
@@ -0,0 +1,47 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[block]]
+struct SB {
+ arg_0: array<f32>;
+};
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+fn arrayLength_b083be() {
+ var res: u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_b083be();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_b083be();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_b083be();
+}
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl
new file mode 100644
index 0000000..25c9fd0
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl
@@ -0,0 +1,26 @@
+
+ByteAddressBuffer sb : register(t0, space0);
+
+void arrayLength_b083be() {
+ uint tint_symbol_1 = 0u;
+ sb.GetDimensions(tint_symbol_1);
+ const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
+ uint res = tint_symbol_2;
+}
+
+void vertex_main() {
+ arrayLength_b083be();
+ return;
+}
+
+void fragment_main() {
+ arrayLength_b083be();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ arrayLength_b083be();
+ return;
+}
+
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl
new file mode 100644
index 0000000..a3eaf1b
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl
@@ -0,0 +1,30 @@
+SKIP: FAILED
+
+
+[[block]]
+struct SB {
+ arg_0 : array<f32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_b083be() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_b083be();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_b083be();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_b083be();
+}
+
+Failed to generate: error: Unknown import method: arrayLength
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm
new file mode 100644
index 0000000..33c66cb
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %SB "SB"
+ OpMemberName %SB 0 "arg_0"
+ OpName %sb "sb"
+ OpName %arrayLength_b083be "arrayLength_b083be"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %SB Block
+ OpMemberDecorate %SB 0 Offset 0
+ OpDecorate %_runtimearr_float ArrayStride 4
+ OpDecorate %sb NonWritable
+ OpDecorate %sb DescriptorSet 0
+ OpDecorate %sb Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+%_runtimearr_float = OpTypeRuntimeArray %float
+ %SB = OpTypeStruct %_runtimearr_float
+%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
+ %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %17 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%arrayLength_b083be = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %17
+ %13 = OpArrayLength %uint %sb 0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %arrayLength_b083be
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %arrayLength_b083be
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %arrayLength_b083be
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl
new file mode 100644
index 0000000..0e15631
--- /dev/null
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+[[block]]
+struct SB {
+ arg_0 : array<f32>;
+};
+
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+
+fn arrayLength_b083be() {
+ var res : u32 = arrayLength(sb.arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ arrayLength_b083be();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ arrayLength_b083be();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ arrayLength_b083be();
+}
diff --git a/test/intrinsics/gen/asin/064953.wgsl b/test/intrinsics/gen/asin/064953.wgsl
new file mode 100644
index 0000000..ce34400
--- /dev/null
+++ b/test/intrinsics/gen/asin/064953.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn asin_064953() {
+ var res: vec4<f32> = asin(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_064953();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_064953();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_064953();
+}
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl
new file mode 100644
index 0000000..1e260dc
--- /dev/null
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void asin_064953() {
+ float4 res = asin(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ asin_064953();
+ return;
+}
+
+void fragment_main() {
+ asin_064953();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ asin_064953();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.msl b/test/intrinsics/gen/asin/064953.wgsl.expected.msl
new file mode 100644
index 0000000..ea21d8a
--- /dev/null
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void asin_064953() {
+ float4 res = asin(float4());
+}
+
+vertex void vertex_main() {
+ asin_064953();
+ return;
+}
+
+fragment void fragment_main() {
+ asin_064953();
+ return;
+}
+
+kernel void compute_main() {
+ asin_064953();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm
new file mode 100644
index 0000000..e98a980
--- /dev/null
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %asin_064953 "asin_064953"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%asin_064953 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Asin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %asin_064953
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %asin_064953
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %asin_064953
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl
new file mode 100644
index 0000000..0746a72
--- /dev/null
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn asin_064953() {
+ var res : vec4<f32> = asin(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_064953();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_064953();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_064953();
+}
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl
new file mode 100644
index 0000000..1d522fa
--- /dev/null
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn asin_7b6a44() {
+ var res: vec2<f32> = asin(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_7b6a44();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_7b6a44();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_7b6a44();
+}
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl
new file mode 100644
index 0000000..a013ed1
--- /dev/null
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void asin_7b6a44() {
+ float2 res = asin(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ asin_7b6a44();
+ return;
+}
+
+void fragment_main() {
+ asin_7b6a44();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ asin_7b6a44();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl
new file mode 100644
index 0000000..8e9f1e5
--- /dev/null
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void asin_7b6a44() {
+ float2 res = asin(float2());
+}
+
+vertex void vertex_main() {
+ asin_7b6a44();
+ return;
+}
+
+fragment void fragment_main() {
+ asin_7b6a44();
+ return;
+}
+
+kernel void compute_main() {
+ asin_7b6a44();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm
new file mode 100644
index 0000000..aca13be
--- /dev/null
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %asin_7b6a44 "asin_7b6a44"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%asin_7b6a44 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Asin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %asin_7b6a44
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %asin_7b6a44
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %asin_7b6a44
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl
new file mode 100644
index 0000000..20048a9
--- /dev/null
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn asin_7b6a44() {
+ var res : vec2<f32> = asin(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_7b6a44();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_7b6a44();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_7b6a44();
+}
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl
new file mode 100644
index 0000000..047d99f
--- /dev/null
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn asin_8cd9c9() {
+ var res: vec3<f32> = asin(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_8cd9c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_8cd9c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_8cd9c9();
+}
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl
new file mode 100644
index 0000000..9215dcd
--- /dev/null
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void asin_8cd9c9() {
+ float3 res = asin(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ asin_8cd9c9();
+ return;
+}
+
+void fragment_main() {
+ asin_8cd9c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ asin_8cd9c9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl
new file mode 100644
index 0000000..07bd712
--- /dev/null
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void asin_8cd9c9() {
+ float3 res = asin(float3());
+}
+
+vertex void vertex_main() {
+ asin_8cd9c9();
+ return;
+}
+
+fragment void fragment_main() {
+ asin_8cd9c9();
+ return;
+}
+
+kernel void compute_main() {
+ asin_8cd9c9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..ca65452
--- /dev/null
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %asin_8cd9c9 "asin_8cd9c9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%asin_8cd9c9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Asin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %asin_8cd9c9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %asin_8cd9c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %asin_8cd9c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..a86e69f
--- /dev/null
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn asin_8cd9c9() {
+ var res : vec3<f32> = asin(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_8cd9c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_8cd9c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_8cd9c9();
+}
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl
new file mode 100644
index 0000000..6c7f9d6
--- /dev/null
+++ b/test/intrinsics/gen/asin/c0c272.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn asin_c0c272() {
+ var res: f32 = asin(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_c0c272();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_c0c272();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_c0c272();
+}
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl
new file mode 100644
index 0000000..2c5b742
--- /dev/null
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void asin_c0c272() {
+ float res = asin(1.0f);
+}
+
+void vertex_main() {
+ asin_c0c272();
+ return;
+}
+
+void fragment_main() {
+ asin_c0c272();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ asin_c0c272();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl
new file mode 100644
index 0000000..87b650d
--- /dev/null
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void asin_c0c272() {
+ float res = asin(1.0f);
+}
+
+vertex void vertex_main() {
+ asin_c0c272();
+ return;
+}
+
+fragment void fragment_main() {
+ asin_c0c272();
+ return;
+}
+
+kernel void compute_main() {
+ asin_c0c272();
+ return;
+}
+
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm
new file mode 100644
index 0000000..7c1af87
--- /dev/null
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %asin_c0c272 "asin_c0c272"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%asin_c0c272 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Asin %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %asin_c0c272
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %asin_c0c272
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %asin_c0c272
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl
new file mode 100644
index 0000000..dc482f3
--- /dev/null
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn asin_c0c272() {
+ var res : f32 = asin(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ asin_c0c272();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ asin_c0c272();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ asin_c0c272();
+}
diff --git a/test/intrinsics/gen/atan/02979a.wgsl b/test/intrinsics/gen/atan/02979a.wgsl
new file mode 100644
index 0000000..0756a8c
--- /dev/null
+++ b/test/intrinsics/gen/atan/02979a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan_02979a() {
+ var res: f32 = atan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_02979a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_02979a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_02979a();
+}
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl
new file mode 100644
index 0000000..03255a9
--- /dev/null
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void atan_02979a() {
+ float res = atan(1.0f);
+}
+
+void vertex_main() {
+ atan_02979a();
+ return;
+}
+
+void fragment_main() {
+ atan_02979a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan_02979a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl
new file mode 100644
index 0000000..ad8db82
--- /dev/null
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan_02979a() {
+ float res = atan(1.0f);
+}
+
+vertex void vertex_main() {
+ atan_02979a();
+ return;
+}
+
+fragment void fragment_main() {
+ atan_02979a();
+ return;
+}
+
+kernel void compute_main() {
+ atan_02979a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm
new file mode 100644
index 0000000..5b3a53c
--- /dev/null
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan_02979a "atan_02979a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%atan_02979a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Atan %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %atan_02979a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %atan_02979a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %atan_02979a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl
new file mode 100644
index 0000000..02da0b0
--- /dev/null
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan_02979a() {
+ var res : f32 = atan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_02979a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_02979a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_02979a();
+}
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl
new file mode 100644
index 0000000..2b4def5
--- /dev/null
+++ b/test/intrinsics/gen/atan/331e6d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan_331e6d() {
+ var res: vec3<f32> = atan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_331e6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_331e6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_331e6d();
+}
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl
new file mode 100644
index 0000000..69a677d
--- /dev/null
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void atan_331e6d() {
+ float3 res = atan(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan_331e6d();
+ return;
+}
+
+void fragment_main() {
+ atan_331e6d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan_331e6d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl
new file mode 100644
index 0000000..77fe0cb
--- /dev/null
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan_331e6d() {
+ float3 res = atan(float3());
+}
+
+vertex void vertex_main() {
+ atan_331e6d();
+ return;
+}
+
+fragment void fragment_main() {
+ atan_331e6d();
+ return;
+}
+
+kernel void compute_main() {
+ atan_331e6d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm
new file mode 100644
index 0000000..1a1c43d
--- /dev/null
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan_331e6d "atan_331e6d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%atan_331e6d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Atan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan_331e6d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan_331e6d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan_331e6d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl
new file mode 100644
index 0000000..dd33001
--- /dev/null
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan_331e6d() {
+ var res : vec3<f32> = atan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_331e6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_331e6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_331e6d();
+}
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl
new file mode 100644
index 0000000..ab30f52
--- /dev/null
+++ b/test/intrinsics/gen/atan/a8b696.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan_a8b696() {
+ var res: vec4<f32> = atan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_a8b696();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_a8b696();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_a8b696();
+}
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl
new file mode 100644
index 0000000..10825e8
--- /dev/null
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void atan_a8b696() {
+ float4 res = atan(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan_a8b696();
+ return;
+}
+
+void fragment_main() {
+ atan_a8b696();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan_a8b696();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl
new file mode 100644
index 0000000..3c5b1d7
--- /dev/null
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan_a8b696() {
+ float4 res = atan(float4());
+}
+
+vertex void vertex_main() {
+ atan_a8b696();
+ return;
+}
+
+fragment void fragment_main() {
+ atan_a8b696();
+ return;
+}
+
+kernel void compute_main() {
+ atan_a8b696();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm
new file mode 100644
index 0000000..88f6765
--- /dev/null
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan_a8b696 "atan_a8b696"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%atan_a8b696 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Atan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan_a8b696
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan_a8b696
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan_a8b696
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl
new file mode 100644
index 0000000..22e4087
--- /dev/null
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan_a8b696() {
+ var res : vec4<f32> = atan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_a8b696();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_a8b696();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_a8b696();
+}
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl
new file mode 100644
index 0000000..0ed39c1
--- /dev/null
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan_ad96e4() {
+ var res: vec2<f32> = atan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_ad96e4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_ad96e4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_ad96e4();
+}
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl
new file mode 100644
index 0000000..32b7f36
--- /dev/null
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void atan_ad96e4() {
+ float2 res = atan(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan_ad96e4();
+ return;
+}
+
+void fragment_main() {
+ atan_ad96e4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan_ad96e4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl
new file mode 100644
index 0000000..d4b1639
--- /dev/null
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan_ad96e4() {
+ float2 res = atan(float2());
+}
+
+vertex void vertex_main() {
+ atan_ad96e4();
+ return;
+}
+
+fragment void fragment_main() {
+ atan_ad96e4();
+ return;
+}
+
+kernel void compute_main() {
+ atan_ad96e4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c1efbf
--- /dev/null
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan_ad96e4 "atan_ad96e4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%atan_ad96e4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Atan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan_ad96e4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan_ad96e4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan_ad96e4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl
new file mode 100644
index 0000000..4806af3
--- /dev/null
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan_ad96e4() {
+ var res : vec2<f32> = atan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan_ad96e4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan_ad96e4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan_ad96e4();
+}
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl
new file mode 100644
index 0000000..0d662ca
--- /dev/null
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan2_57fb13() {
+ var res: vec2<f32> = atan2(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_57fb13();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_57fb13();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_57fb13();
+}
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl
new file mode 100644
index 0000000..e511c42
--- /dev/null
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void atan2_57fb13() {
+ float2 res = atan2(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan2_57fb13();
+ return;
+}
+
+void fragment_main() {
+ atan2_57fb13();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan2_57fb13();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl
new file mode 100644
index 0000000..e6adbc9
--- /dev/null
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan2_57fb13() {
+ float2 res = atan2(float2(), float2());
+}
+
+vertex void vertex_main() {
+ atan2_57fb13();
+ return;
+}
+
+fragment void fragment_main() {
+ atan2_57fb13();
+ return;
+}
+
+kernel void compute_main() {
+ atan2_57fb13();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ad6a7b
--- /dev/null
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan2_57fb13 "atan2_57fb13"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%atan2_57fb13 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Atan2 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan2_57fb13
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan2_57fb13
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan2_57fb13
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl
new file mode 100644
index 0000000..9eeb50e
--- /dev/null
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan2_57fb13() {
+ var res : vec2<f32> = atan2(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_57fb13();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_57fb13();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_57fb13();
+}
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl
new file mode 100644
index 0000000..c48ea4d
--- /dev/null
+++ b/test/intrinsics/gen/atan2/96057c.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan2_96057c() {
+ var res: f32 = atan2(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_96057c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_96057c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_96057c();
+}
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl
new file mode 100644
index 0000000..6148ace
--- /dev/null
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void atan2_96057c() {
+ float res = atan2(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ atan2_96057c();
+ return;
+}
+
+void fragment_main() {
+ atan2_96057c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan2_96057c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl
new file mode 100644
index 0000000..6dd610f
--- /dev/null
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan2_96057c() {
+ float res = atan2(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ atan2_96057c();
+ return;
+}
+
+fragment void fragment_main() {
+ atan2_96057c();
+ return;
+}
+
+kernel void compute_main() {
+ atan2_96057c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm
new file mode 100644
index 0000000..2d93e05
--- /dev/null
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan2_96057c "atan2_96057c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%atan2_96057c = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Atan2 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %atan2_96057c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %atan2_96057c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %atan2_96057c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl
new file mode 100644
index 0000000..5196c86
--- /dev/null
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan2_96057c() {
+ var res : f32 = atan2(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_96057c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_96057c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_96057c();
+}
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl
new file mode 100644
index 0000000..9803266
--- /dev/null
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan2_a70d0d() {
+ var res: vec3<f32> = atan2(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_a70d0d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_a70d0d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_a70d0d();
+}
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl
new file mode 100644
index 0000000..49a82da
--- /dev/null
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void atan2_a70d0d() {
+ float3 res = atan2(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan2_a70d0d();
+ return;
+}
+
+void fragment_main() {
+ atan2_a70d0d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan2_a70d0d();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl
new file mode 100644
index 0000000..867ab02
--- /dev/null
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan2_a70d0d() {
+ float3 res = atan2(float3(), float3());
+}
+
+vertex void vertex_main() {
+ atan2_a70d0d();
+ return;
+}
+
+fragment void fragment_main() {
+ atan2_a70d0d();
+ return;
+}
+
+kernel void compute_main() {
+ atan2_a70d0d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm
new file mode 100644
index 0000000..8a2ce3a
--- /dev/null
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan2_a70d0d "atan2_a70d0d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%atan2_a70d0d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Atan2 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan2_a70d0d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan2_a70d0d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan2_a70d0d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl
new file mode 100644
index 0000000..81cbd0b
--- /dev/null
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan2_a70d0d() {
+ var res : vec3<f32> = atan2(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_a70d0d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_a70d0d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_a70d0d();
+}
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl
new file mode 100644
index 0000000..19090fd
--- /dev/null
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn atan2_ae713e() {
+ var res: vec4<f32> = atan2(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_ae713e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_ae713e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_ae713e();
+}
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl
new file mode 100644
index 0000000..a72a697
--- /dev/null
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void atan2_ae713e() {
+ float4 res = atan2(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ atan2_ae713e();
+ return;
+}
+
+void fragment_main() {
+ atan2_ae713e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ atan2_ae713e();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl
new file mode 100644
index 0000000..5afdaf1
--- /dev/null
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void atan2_ae713e() {
+ float4 res = atan2(float4(), float4());
+}
+
+vertex void vertex_main() {
+ atan2_ae713e();
+ return;
+}
+
+fragment void fragment_main() {
+ atan2_ae713e();
+ return;
+}
+
+kernel void compute_main() {
+ atan2_ae713e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm
new file mode 100644
index 0000000..f97c71e
--- /dev/null
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %atan2_ae713e "atan2_ae713e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%atan2_ae713e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Atan2 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %atan2_ae713e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %atan2_ae713e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %atan2_ae713e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f36d2f
--- /dev/null
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn atan2_ae713e() {
+ var res : vec4<f32> = atan2(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ atan2_ae713e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ atan2_ae713e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ atan2_ae713e();
+}
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl
new file mode 100644
index 0000000..3a761a8
--- /dev/null
+++ b/test/intrinsics/gen/ceil/34064b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ceil_34064b() {
+ var res: vec3<f32> = ceil(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_34064b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_34064b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_34064b();
+}
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl
new file mode 100644
index 0000000..8a08ba8
--- /dev/null
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ceil_34064b() {
+ float3 res = ceil(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ ceil_34064b();
+ return;
+}
+
+void fragment_main() {
+ ceil_34064b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ceil_34064b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl
new file mode 100644
index 0000000..bdee65c
--- /dev/null
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ceil_34064b() {
+ float3 res = ceil(float3());
+}
+
+vertex void vertex_main() {
+ ceil_34064b();
+ return;
+}
+
+fragment void fragment_main() {
+ ceil_34064b();
+ return;
+}
+
+kernel void compute_main() {
+ ceil_34064b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm
new file mode 100644
index 0000000..93ef755
--- /dev/null
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ceil_34064b "ceil_34064b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%ceil_34064b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Ceil %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %ceil_34064b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %ceil_34064b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ceil_34064b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl
new file mode 100644
index 0000000..db216bd
--- /dev/null
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ceil_34064b() {
+ var res : vec3<f32> = ceil(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_34064b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_34064b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_34064b();
+}
diff --git a/test/intrinsics/gen/ceil/678655.wgsl b/test/intrinsics/gen/ceil/678655.wgsl
new file mode 100644
index 0000000..d6fd59e
--- /dev/null
+++ b/test/intrinsics/gen/ceil/678655.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ceil_678655() {
+ var res: f32 = ceil(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_678655();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_678655();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_678655();
+}
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl
new file mode 100644
index 0000000..a464471
--- /dev/null
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ceil_678655() {
+ float res = ceil(1.0f);
+}
+
+void vertex_main() {
+ ceil_678655();
+ return;
+}
+
+void fragment_main() {
+ ceil_678655();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ceil_678655();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl
new file mode 100644
index 0000000..2ee1b99
--- /dev/null
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ceil_678655() {
+ float res = ceil(1.0f);
+}
+
+vertex void vertex_main() {
+ ceil_678655();
+ return;
+}
+
+fragment void fragment_main() {
+ ceil_678655();
+ return;
+}
+
+kernel void compute_main() {
+ ceil_678655();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm
new file mode 100644
index 0000000..7e9d904
--- /dev/null
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ceil_678655 "ceil_678655"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%ceil_678655 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Ceil %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %ceil_678655
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %ceil_678655
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %ceil_678655
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl
new file mode 100644
index 0000000..93141ee
--- /dev/null
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ceil_678655() {
+ var res : f32 = ceil(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_678655();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_678655();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_678655();
+}
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl
new file mode 100644
index 0000000..8be5f58
--- /dev/null
+++ b/test/intrinsics/gen/ceil/96f597.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ceil_96f597() {
+ var res: vec2<f32> = ceil(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_96f597();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_96f597();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_96f597();
+}
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl
new file mode 100644
index 0000000..0c6ec13
--- /dev/null
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ceil_96f597() {
+ float2 res = ceil(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ ceil_96f597();
+ return;
+}
+
+void fragment_main() {
+ ceil_96f597();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ceil_96f597();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl
new file mode 100644
index 0000000..e7fac87
--- /dev/null
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ceil_96f597() {
+ float2 res = ceil(float2());
+}
+
+vertex void vertex_main() {
+ ceil_96f597();
+ return;
+}
+
+fragment void fragment_main() {
+ ceil_96f597();
+ return;
+}
+
+kernel void compute_main() {
+ ceil_96f597();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c6fc2d
--- /dev/null
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ceil_96f597 "ceil_96f597"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%ceil_96f597 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Ceil %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %ceil_96f597
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %ceil_96f597
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ceil_96f597
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl
new file mode 100644
index 0000000..0f19eb3
--- /dev/null
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ceil_96f597() {
+ var res : vec2<f32> = ceil(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_96f597();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_96f597();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_96f597();
+}
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl
new file mode 100644
index 0000000..bff6a37
--- /dev/null
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ceil_b74c16() {
+ var res: vec4<f32> = ceil(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_b74c16();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_b74c16();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_b74c16();
+}
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl
new file mode 100644
index 0000000..8a24e8f
--- /dev/null
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ceil_b74c16() {
+ float4 res = ceil(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ ceil_b74c16();
+ return;
+}
+
+void fragment_main() {
+ ceil_b74c16();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ceil_b74c16();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl
new file mode 100644
index 0000000..85755c8
--- /dev/null
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ceil_b74c16() {
+ float4 res = ceil(float4());
+}
+
+vertex void vertex_main() {
+ ceil_b74c16();
+ return;
+}
+
+fragment void fragment_main() {
+ ceil_b74c16();
+ return;
+}
+
+kernel void compute_main() {
+ ceil_b74c16();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm
new file mode 100644
index 0000000..8acc0f5
--- /dev/null
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ceil_b74c16 "ceil_b74c16"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%ceil_b74c16 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Ceil %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %ceil_b74c16
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %ceil_b74c16
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ceil_b74c16
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl
new file mode 100644
index 0000000..31a84dc
--- /dev/null
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ceil_b74c16() {
+ var res : vec4<f32> = ceil(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ceil_b74c16();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ceil_b74c16();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ceil_b74c16();
+}
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl
new file mode 100644
index 0000000..1cd0210
--- /dev/null
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_0acf8f() {
+ var res: vec2<f32> = clamp(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_0acf8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_0acf8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_0acf8f();
+}
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl
new file mode 100644
index 0000000..842215f
--- /dev/null
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_0acf8f() {
+ float2 res = clamp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ clamp_0acf8f();
+ return;
+}
+
+void fragment_main() {
+ clamp_0acf8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_0acf8f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl
new file mode 100644
index 0000000..a037369
--- /dev/null
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_0acf8f() {
+ float2 res = clamp(float2(), float2(), float2());
+}
+
+vertex void vertex_main() {
+ clamp_0acf8f();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_0acf8f();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_0acf8f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..407ba2e
--- /dev/null
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_0acf8f "clamp_0acf8f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%clamp_0acf8f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 NClamp %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %clamp_0acf8f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %clamp_0acf8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %clamp_0acf8f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..bddaa44
--- /dev/null
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_0acf8f() {
+ var res : vec2<f32> = clamp(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_0acf8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_0acf8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_0acf8f();
+}
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl
new file mode 100644
index 0000000..09c42a5
--- /dev/null
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_1a32e3() {
+ var res: vec4<i32> = clamp(vec4<i32>(), vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_1a32e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_1a32e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_1a32e3();
+}
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl
new file mode 100644
index 0000000..55b87de
--- /dev/null
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_1a32e3() {
+ int4 res = clamp(int4(0, 0, 0, 0), int4(0, 0, 0, 0), int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ clamp_1a32e3();
+ return;
+}
+
+void fragment_main() {
+ clamp_1a32e3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_1a32e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl
new file mode 100644
index 0000000..c0bea6f
--- /dev/null
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_1a32e3() {
+ int4 res = clamp(int4(), int4(), int4());
+}
+
+vertex void vertex_main() {
+ clamp_1a32e3();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_1a32e3();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_1a32e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm
new file mode 100644
index 0000000..3359379
--- /dev/null
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_1a32e3 "clamp_1a32e3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %13 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+%clamp_1a32e3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %13
+ %9 = OpExtInst %v4int %12 SClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_1a32e3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_1a32e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_1a32e3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl
new file mode 100644
index 0000000..27ba95d
--- /dev/null
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_1a32e3() {
+ var res : vec4<i32> = clamp(vec4<i32>(), vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_1a32e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_1a32e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_1a32e3();
+}
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl
new file mode 100644
index 0000000..53f74c8
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_2bd567() {
+ var res: f32 = clamp(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_2bd567();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_2bd567();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_2bd567();
+}
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl
new file mode 100644
index 0000000..6650a46
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_2bd567() {
+ float res = clamp(1.0f, 1.0f, 1.0f);
+}
+
+void vertex_main() {
+ clamp_2bd567();
+ return;
+}
+
+void fragment_main() {
+ clamp_2bd567();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_2bd567();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl
new file mode 100644
index 0000000..fd397f1
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_2bd567() {
+ float res = clamp(1.0f, 1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ clamp_2bd567();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_2bd567();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_2bd567();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm
new file mode 100644
index 0000000..74eb006
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_2bd567 "clamp_2bd567"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%clamp_2bd567 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 NClamp %float_1 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %clamp_2bd567
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %clamp_2bd567
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_2bd567
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl
new file mode 100644
index 0000000..84ab121
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_2bd567() {
+ var res : f32 = clamp(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_2bd567();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_2bd567();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_2bd567();
+}
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl
new file mode 100644
index 0000000..d3e75b0
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_2bde41() {
+ var res: vec4<f32> = clamp(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_2bde41();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_2bde41();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_2bde41();
+}
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl
new file mode 100644
index 0000000..f6485cb
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_2bde41() {
+ float4 res = clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ clamp_2bde41();
+ return;
+}
+
+void fragment_main() {
+ clamp_2bde41();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_2bde41();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl
new file mode 100644
index 0000000..300b88a
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_2bde41() {
+ float4 res = clamp(float4(), float4(), float4());
+}
+
+vertex void vertex_main() {
+ clamp_2bde41();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_2bde41();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_2bde41();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm
new file mode 100644
index 0000000..893bd08
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_2bde41 "clamp_2bde41"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%clamp_2bde41 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 NClamp %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %clamp_2bde41
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %clamp_2bde41
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %clamp_2bde41
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl
new file mode 100644
index 0000000..5956f67
--- /dev/null
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_2bde41() {
+ var res : vec4<f32> = clamp(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_2bde41();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_2bde41();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_2bde41();
+}
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl
new file mode 100644
index 0000000..c1c22c5
--- /dev/null
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_548fc7() {
+ var res: vec3<u32> = clamp(vec3<u32>(), vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_548fc7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_548fc7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_548fc7();
+}
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl
new file mode 100644
index 0000000..019054e
--- /dev/null
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_548fc7() {
+ uint3 res = clamp(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ clamp_548fc7();
+ return;
+}
+
+void fragment_main() {
+ clamp_548fc7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_548fc7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl
new file mode 100644
index 0000000..cd95893
--- /dev/null
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_548fc7() {
+ uint3 res = clamp(uint3(), uint3(), uint3());
+}
+
+vertex void vertex_main() {
+ clamp_548fc7();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_548fc7();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_548fc7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm
new file mode 100644
index 0000000..37f7fb7
--- /dev/null
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_548fc7 "clamp_548fc7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %13 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+%clamp_548fc7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %13
+ %9 = OpExtInst %v3uint %12 UClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_548fc7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_548fc7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_548fc7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl
new file mode 100644
index 0000000..0a5ebca
--- /dev/null
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_548fc7() {
+ var res : vec3<u32> = clamp(vec3<u32>(), vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_548fc7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_548fc7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_548fc7();
+}
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl
new file mode 100644
index 0000000..3f832c6
--- /dev/null
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_5f0819() {
+ var res: vec3<i32> = clamp(vec3<i32>(), vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_5f0819();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_5f0819();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_5f0819();
+}
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl
new file mode 100644
index 0000000..4c53393
--- /dev/null
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_5f0819() {
+ int3 res = clamp(int3(0, 0, 0), int3(0, 0, 0), int3(0, 0, 0));
+}
+
+void vertex_main() {
+ clamp_5f0819();
+ return;
+}
+
+void fragment_main() {
+ clamp_5f0819();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_5f0819();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl
new file mode 100644
index 0000000..758dfaf
--- /dev/null
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_5f0819() {
+ int3 res = clamp(int3(), int3(), int3());
+}
+
+vertex void vertex_main() {
+ clamp_5f0819();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_5f0819();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_5f0819();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d75c73
--- /dev/null
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_5f0819 "clamp_5f0819"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %13 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+%clamp_5f0819 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %13
+ %9 = OpExtInst %v3int %12 SClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_5f0819
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_5f0819
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_5f0819
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl
new file mode 100644
index 0000000..5490dff
--- /dev/null
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_5f0819() {
+ var res : vec3<i32> = clamp(vec3<i32>(), vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_5f0819();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_5f0819();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_5f0819();
+}
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl
new file mode 100644
index 0000000..50c6ecb
--- /dev/null
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_6c1749() {
+ var res: vec2<i32> = clamp(vec2<i32>(), vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_6c1749();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_6c1749();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_6c1749();
+}
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl
new file mode 100644
index 0000000..df70177
--- /dev/null
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_6c1749() {
+ int2 res = clamp(int2(0, 0), int2(0, 0), int2(0, 0));
+}
+
+void vertex_main() {
+ clamp_6c1749();
+ return;
+}
+
+void fragment_main() {
+ clamp_6c1749();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_6c1749();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl
new file mode 100644
index 0000000..34397b6
--- /dev/null
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_6c1749() {
+ int2 res = clamp(int2(), int2(), int2());
+}
+
+vertex void vertex_main() {
+ clamp_6c1749();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_6c1749();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_6c1749();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm
new file mode 100644
index 0000000..892edaf
--- /dev/null
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_6c1749 "clamp_6c1749"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %13 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+%clamp_6c1749 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %13
+ %9 = OpExtInst %v2int %12 SClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_6c1749
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_6c1749
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_6c1749
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl
new file mode 100644
index 0000000..bc424ec
--- /dev/null
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_6c1749() {
+ var res : vec2<i32> = clamp(vec2<i32>(), vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_6c1749();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_6c1749();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_6c1749();
+}
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl
new file mode 100644
index 0000000..20b0214
--- /dev/null
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_7706d7() {
+ var res: vec2<u32> = clamp(vec2<u32>(), vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_7706d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_7706d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_7706d7();
+}
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl
new file mode 100644
index 0000000..ac8e422
--- /dev/null
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_7706d7() {
+ uint2 res = clamp(uint2(0u, 0u), uint2(0u, 0u), uint2(0u, 0u));
+}
+
+void vertex_main() {
+ clamp_7706d7();
+ return;
+}
+
+void fragment_main() {
+ clamp_7706d7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_7706d7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl
new file mode 100644
index 0000000..4faae26
--- /dev/null
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_7706d7() {
+ uint2 res = clamp(uint2(), uint2(), uint2());
+}
+
+vertex void vertex_main() {
+ clamp_7706d7();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_7706d7();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_7706d7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ecc8de
--- /dev/null
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_7706d7 "clamp_7706d7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %13 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+%clamp_7706d7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %13
+ %9 = OpExtInst %v2uint %12 UClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_7706d7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_7706d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_7706d7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl
new file mode 100644
index 0000000..76996d8
--- /dev/null
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_7706d7() {
+ var res : vec2<u32> = clamp(vec2<u32>(), vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_7706d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_7706d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_7706d7();
+}
diff --git a/test/intrinsics/gen/clamp/867397.wgsl b/test/intrinsics/gen/clamp/867397.wgsl
new file mode 100644
index 0000000..51dbf3a
--- /dev/null
+++ b/test/intrinsics/gen/clamp/867397.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_867397() {
+ var res: vec3<f32> = clamp(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_867397();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_867397();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_867397();
+}
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl
new file mode 100644
index 0000000..fb3b131
--- /dev/null
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_867397() {
+ float3 res = clamp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ clamp_867397();
+ return;
+}
+
+void fragment_main() {
+ clamp_867397();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_867397();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl
new file mode 100644
index 0000000..a3647ec
--- /dev/null
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_867397() {
+ float3 res = clamp(float3(), float3(), float3());
+}
+
+vertex void vertex_main() {
+ clamp_867397();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_867397();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_867397();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm
new file mode 100644
index 0000000..f635487
--- /dev/null
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_867397 "clamp_867397"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%clamp_867397 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 NClamp %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %clamp_867397
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %clamp_867397
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %clamp_867397
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl
new file mode 100644
index 0000000..ee22ec7
--- /dev/null
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_867397() {
+ var res : vec3<f32> = clamp(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_867397();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_867397();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_867397();
+}
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl
new file mode 100644
index 0000000..57398ae
--- /dev/null
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_a2de25() {
+ var res: u32 = clamp(1u, 1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_a2de25();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_a2de25();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_a2de25();
+}
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl
new file mode 100644
index 0000000..d051684
--- /dev/null
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_a2de25() {
+ uint res = clamp(1u, 1u, 1u);
+}
+
+void vertex_main() {
+ clamp_a2de25();
+ return;
+}
+
+void fragment_main() {
+ clamp_a2de25();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_a2de25();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl
new file mode 100644
index 0000000..723dcce
--- /dev/null
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_a2de25() {
+ uint res = clamp(1u, 1u, 1u);
+}
+
+vertex void vertex_main() {
+ clamp_a2de25();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_a2de25();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_a2de25();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm
new file mode 100644
index 0000000..1e40fa9
--- /dev/null
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_a2de25 "clamp_a2de25"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %15 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%clamp_a2de25 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %15
+ %9 = OpExtInst %uint %11 UClamp %uint_1 %uint_1 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_a2de25
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_a2de25
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_a2de25
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl
new file mode 100644
index 0000000..dcc288b
--- /dev/null
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_a2de25() {
+ var res : u32 = clamp(1u, 1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_a2de25();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_a2de25();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_a2de25();
+}
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl
new file mode 100644
index 0000000..26037c0
--- /dev/null
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_b07c65() {
+ var res: i32 = clamp(1, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_b07c65();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_b07c65();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_b07c65();
+}
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl
new file mode 100644
index 0000000..1e0f3b7
--- /dev/null
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_b07c65() {
+ int res = clamp(1, 1, 1);
+}
+
+void vertex_main() {
+ clamp_b07c65();
+ return;
+}
+
+void fragment_main() {
+ clamp_b07c65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_b07c65();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl
new file mode 100644
index 0000000..66c5ed1
--- /dev/null
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_b07c65() {
+ int res = clamp(1, 1, 1);
+}
+
+vertex void vertex_main() {
+ clamp_b07c65();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_b07c65();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_b07c65();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm
new file mode 100644
index 0000000..766f948
--- /dev/null
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_b07c65 "clamp_b07c65"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %15 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%clamp_b07c65 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %15
+ %9 = OpExtInst %int %11 SClamp %int_1 %int_1 %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_b07c65
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_b07c65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_b07c65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl
new file mode 100644
index 0000000..dcb8def
--- /dev/null
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_b07c65() {
+ var res : i32 = clamp(1, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_b07c65();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_b07c65();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_b07c65();
+}
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl
new file mode 100644
index 0000000..312f5a4
--- /dev/null
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn clamp_bd43ce() {
+ var res: vec4<u32> = clamp(vec4<u32>(), vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_bd43ce();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_bd43ce();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_bd43ce();
+}
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl
new file mode 100644
index 0000000..aff6b0a
--- /dev/null
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void clamp_bd43ce() {
+ uint4 res = clamp(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ clamp_bd43ce();
+ return;
+}
+
+void fragment_main() {
+ clamp_bd43ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ clamp_bd43ce();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl
new file mode 100644
index 0000000..6357503
--- /dev/null
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void clamp_bd43ce() {
+ uint4 res = clamp(uint4(), uint4(), uint4());
+}
+
+vertex void vertex_main() {
+ clamp_bd43ce();
+ return;
+}
+
+fragment void fragment_main() {
+ clamp_bd43ce();
+ return;
+}
+
+kernel void compute_main() {
+ clamp_bd43ce();
+ return;
+}
+
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm
new file mode 100644
index 0000000..2d2fc1f
--- /dev/null
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %clamp_bd43ce "clamp_bd43ce"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %13 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+%clamp_bd43ce = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %13
+ %9 = OpExtInst %v4uint %12 UClamp %13 %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %clamp_bd43ce
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %clamp_bd43ce
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %clamp_bd43ce
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl
new file mode 100644
index 0000000..83486f0
--- /dev/null
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn clamp_bd43ce() {
+ var res : vec4<u32> = clamp(vec4<u32>(), vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ clamp_bd43ce();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ clamp_bd43ce();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ clamp_bd43ce();
+}
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl
new file mode 100644
index 0000000..3be644c
--- /dev/null
+++ b/test/intrinsics/gen/cos/16dc15.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cos_16dc15() {
+ var res: vec3<f32> = cos(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_16dc15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_16dc15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_16dc15();
+}
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl
new file mode 100644
index 0000000..a7f1315
--- /dev/null
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cos_16dc15() {
+ float3 res = cos(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cos_16dc15();
+ return;
+}
+
+void fragment_main() {
+ cos_16dc15();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cos_16dc15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl
new file mode 100644
index 0000000..f82f797
--- /dev/null
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cos_16dc15() {
+ float3 res = cos(float3());
+}
+
+vertex void vertex_main() {
+ cos_16dc15();
+ return;
+}
+
+fragment void fragment_main() {
+ cos_16dc15();
+ return;
+}
+
+kernel void compute_main() {
+ cos_16dc15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm
new file mode 100644
index 0000000..e9373f8
--- /dev/null
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cos_16dc15 "cos_16dc15"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %cos_16dc15 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Cos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cos_16dc15
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cos_16dc15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cos_16dc15
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl
new file mode 100644
index 0000000..556d991
--- /dev/null
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cos_16dc15() {
+ var res : vec3<f32> = cos(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_16dc15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_16dc15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_16dc15();
+}
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl
new file mode 100644
index 0000000..ac2ac10
--- /dev/null
+++ b/test/intrinsics/gen/cos/29d66d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cos_29d66d() {
+ var res: vec4<f32> = cos(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_29d66d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_29d66d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_29d66d();
+}
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl
new file mode 100644
index 0000000..745c39d
--- /dev/null
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cos_29d66d() {
+ float4 res = cos(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cos_29d66d();
+ return;
+}
+
+void fragment_main() {
+ cos_29d66d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cos_29d66d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl
new file mode 100644
index 0000000..a434cab
--- /dev/null
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cos_29d66d() {
+ float4 res = cos(float4());
+}
+
+vertex void vertex_main() {
+ cos_29d66d();
+ return;
+}
+
+fragment void fragment_main() {
+ cos_29d66d();
+ return;
+}
+
+kernel void compute_main() {
+ cos_29d66d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm
new file mode 100644
index 0000000..b306467
--- /dev/null
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cos_29d66d "cos_29d66d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %cos_29d66d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Cos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cos_29d66d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cos_29d66d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cos_29d66d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl
new file mode 100644
index 0000000..1ae251c
--- /dev/null
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cos_29d66d() {
+ var res : vec4<f32> = cos(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_29d66d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_29d66d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_29d66d();
+}
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl
new file mode 100644
index 0000000..dd860be
--- /dev/null
+++ b/test/intrinsics/gen/cos/c3b486.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cos_c3b486() {
+ var res: vec2<f32> = cos(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_c3b486();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_c3b486();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_c3b486();
+}
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl
new file mode 100644
index 0000000..98a4176
--- /dev/null
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cos_c3b486() {
+ float2 res = cos(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cos_c3b486();
+ return;
+}
+
+void fragment_main() {
+ cos_c3b486();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cos_c3b486();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl
new file mode 100644
index 0000000..2d82317
--- /dev/null
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cos_c3b486() {
+ float2 res = cos(float2());
+}
+
+vertex void vertex_main() {
+ cos_c3b486();
+ return;
+}
+
+fragment void fragment_main() {
+ cos_c3b486();
+ return;
+}
+
+kernel void compute_main() {
+ cos_c3b486();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm
new file mode 100644
index 0000000..14f77a8
--- /dev/null
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cos_c3b486 "cos_c3b486"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %cos_c3b486 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Cos %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cos_c3b486
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cos_c3b486
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cos_c3b486
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl
new file mode 100644
index 0000000..2d585d6
--- /dev/null
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cos_c3b486() {
+ var res : vec2<f32> = cos(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_c3b486();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_c3b486();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_c3b486();
+}
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl
new file mode 100644
index 0000000..33bc9f4
--- /dev/null
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cos_c5c28e() {
+ var res: f32 = cos(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_c5c28e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_c5c28e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_c5c28e();
+}
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl
new file mode 100644
index 0000000..fbd531b
--- /dev/null
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cos_c5c28e() {
+ float res = cos(1.0f);
+}
+
+void vertex_main() {
+ cos_c5c28e();
+ return;
+}
+
+void fragment_main() {
+ cos_c5c28e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cos_c5c28e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl
new file mode 100644
index 0000000..0f1eba6
--- /dev/null
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cos_c5c28e() {
+ float res = cos(1.0f);
+}
+
+vertex void vertex_main() {
+ cos_c5c28e();
+ return;
+}
+
+fragment void fragment_main() {
+ cos_c5c28e();
+ return;
+}
+
+kernel void compute_main() {
+ cos_c5c28e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm
new file mode 100644
index 0000000..1183128
--- /dev/null
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cos_c5c28e "cos_c5c28e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %cos_c5c28e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Cos %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %cos_c5c28e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %cos_c5c28e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %cos_c5c28e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl
new file mode 100644
index 0000000..b4a0453
--- /dev/null
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cos_c5c28e() {
+ var res : f32 = cos(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cos_c5c28e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cos_c5c28e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cos_c5c28e();
+}
diff --git a/test/intrinsics/gen/cosh/377652.wgsl b/test/intrinsics/gen/cosh/377652.wgsl
new file mode 100644
index 0000000..c4e548e
--- /dev/null
+++ b/test/intrinsics/gen/cosh/377652.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cosh_377652() {
+ var res: vec3<f32> = cosh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_377652();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_377652();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_377652();
+}
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl
new file mode 100644
index 0000000..019f1f4
--- /dev/null
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cosh_377652() {
+ float3 res = cosh(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cosh_377652();
+ return;
+}
+
+void fragment_main() {
+ cosh_377652();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cosh_377652();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl
new file mode 100644
index 0000000..0fe5e89
--- /dev/null
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cosh_377652() {
+ float3 res = cosh(float3());
+}
+
+vertex void vertex_main() {
+ cosh_377652();
+ return;
+}
+
+fragment void fragment_main() {
+ cosh_377652();
+ return;
+}
+
+kernel void compute_main() {
+ cosh_377652();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm
new file mode 100644
index 0000000..e007f05
--- /dev/null
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cosh_377652 "cosh_377652"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%cosh_377652 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Cosh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cosh_377652
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cosh_377652
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cosh_377652
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl
new file mode 100644
index 0000000..29fffea
--- /dev/null
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cosh_377652() {
+ var res : vec3<f32> = cosh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_377652();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_377652();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_377652();
+}
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl
new file mode 100644
index 0000000..8d6aced
--- /dev/null
+++ b/test/intrinsics/gen/cosh/c13756.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cosh_c13756() {
+ var res: vec2<f32> = cosh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_c13756();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_c13756();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_c13756();
+}
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl
new file mode 100644
index 0000000..72480be
--- /dev/null
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cosh_c13756() {
+ float2 res = cosh(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cosh_c13756();
+ return;
+}
+
+void fragment_main() {
+ cosh_c13756();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cosh_c13756();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl
new file mode 100644
index 0000000..8d9d463
--- /dev/null
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cosh_c13756() {
+ float2 res = cosh(float2());
+}
+
+vertex void vertex_main() {
+ cosh_c13756();
+ return;
+}
+
+fragment void fragment_main() {
+ cosh_c13756();
+ return;
+}
+
+kernel void compute_main() {
+ cosh_c13756();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm
new file mode 100644
index 0000000..7573451
--- /dev/null
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cosh_c13756 "cosh_c13756"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%cosh_c13756 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Cosh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cosh_c13756
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cosh_c13756
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cosh_c13756
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl
new file mode 100644
index 0000000..688528b
--- /dev/null
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cosh_c13756() {
+ var res : vec2<f32> = cosh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_c13756();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_c13756();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_c13756();
+}
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl
new file mode 100644
index 0000000..da5876c
--- /dev/null
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cosh_da92dd() {
+ var res: f32 = cosh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_da92dd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_da92dd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_da92dd();
+}
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl
new file mode 100644
index 0000000..0452df9
--- /dev/null
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cosh_da92dd() {
+ float res = cosh(1.0f);
+}
+
+void vertex_main() {
+ cosh_da92dd();
+ return;
+}
+
+void fragment_main() {
+ cosh_da92dd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cosh_da92dd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl
new file mode 100644
index 0000000..1455bf7
--- /dev/null
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cosh_da92dd() {
+ float res = cosh(1.0f);
+}
+
+vertex void vertex_main() {
+ cosh_da92dd();
+ return;
+}
+
+fragment void fragment_main() {
+ cosh_da92dd();
+ return;
+}
+
+kernel void compute_main() {
+ cosh_da92dd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ff45d5
--- /dev/null
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cosh_da92dd "cosh_da92dd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%cosh_da92dd = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Cosh %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %cosh_da92dd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %cosh_da92dd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %cosh_da92dd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl
new file mode 100644
index 0000000..b2c83f8
--- /dev/null
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cosh_da92dd() {
+ var res : f32 = cosh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_da92dd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_da92dd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_da92dd();
+}
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl
new file mode 100644
index 0000000..39b3c46
--- /dev/null
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cosh_e0c1de() {
+ var res: vec4<f32> = cosh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_e0c1de();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_e0c1de();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_e0c1de();
+}
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl
new file mode 100644
index 0000000..02e0258
--- /dev/null
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cosh_e0c1de() {
+ float4 res = cosh(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cosh_e0c1de();
+ return;
+}
+
+void fragment_main() {
+ cosh_e0c1de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cosh_e0c1de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl
new file mode 100644
index 0000000..aaf2735
--- /dev/null
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cosh_e0c1de() {
+ float4 res = cosh(float4());
+}
+
+vertex void vertex_main() {
+ cosh_e0c1de();
+ return;
+}
+
+fragment void fragment_main() {
+ cosh_e0c1de();
+ return;
+}
+
+kernel void compute_main() {
+ cosh_e0c1de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm
new file mode 100644
index 0000000..17ecea6
--- /dev/null
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cosh_e0c1de "cosh_e0c1de"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%cosh_e0c1de = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Cosh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cosh_e0c1de
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cosh_e0c1de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cosh_e0c1de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl
new file mode 100644
index 0000000..bb74a37
--- /dev/null
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cosh_e0c1de() {
+ var res : vec4<f32> = cosh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cosh_e0c1de();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cosh_e0c1de();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cosh_e0c1de();
+}
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl
new file mode 100644
index 0000000..7dc18e7
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_0d0e46() {
+ var res: vec4<u32> = countOneBits(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_0d0e46();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_0d0e46();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_0d0e46();
+}
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl
new file mode 100644
index 0000000..dcb86cd
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_0d0e46() {
+ uint4 res = countbits(uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl
new file mode 100644
index 0000000..54b1390
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_0d0e46() {
+ uint4 res = popcount(uint4());
+}
+
+vertex void vertex_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_0d0e46();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm
new file mode 100644
index 0000000..e17d9f3
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_0d0e46 "countOneBits_0d0e46"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %12 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+%countOneBits_0d0e46 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %12
+ %9 = OpBitCount %v4uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_0d0e46
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_0d0e46
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_0d0e46
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl
new file mode 100644
index 0000000..561970b
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_0d0e46() {
+ var res : vec4<u32> = countOneBits(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_0d0e46();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_0d0e46();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_0d0e46();
+}
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl
new file mode 100644
index 0000000..6ffa27d
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_0f7980() {
+ var res: vec4<i32> = countOneBits(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_0f7980();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_0f7980();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_0f7980();
+}
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl
new file mode 100644
index 0000000..1c0cab4
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_0f7980() {
+ int4 res = countbits(int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ countOneBits_0f7980();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_0f7980();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_0f7980();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl
new file mode 100644
index 0000000..2f29707
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_0f7980() {
+ int4 res = popcount(int4());
+}
+
+vertex void vertex_main() {
+ countOneBits_0f7980();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_0f7980();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_0f7980();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm
new file mode 100644
index 0000000..e20c852
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_0f7980 "countOneBits_0f7980"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %12 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+%countOneBits_0f7980 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %12
+ %9 = OpBitCount %v4int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_0f7980
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_0f7980
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_0f7980
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl
new file mode 100644
index 0000000..79e2582
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_0f7980() {
+ var res : vec4<i32> = countOneBits(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_0f7980();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_0f7980();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_0f7980();
+}
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl
new file mode 100644
index 0000000..3c07f8a
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_65d2ae() {
+ var res: vec3<i32> = countOneBits(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_65d2ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_65d2ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_65d2ae();
+}
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl
new file mode 100644
index 0000000..1158671
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_65d2ae() {
+ int3 res = countbits(int3(0, 0, 0));
+}
+
+void vertex_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl
new file mode 100644
index 0000000..1cf0ffd
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_65d2ae() {
+ int3 res = popcount(int3());
+}
+
+vertex void vertex_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_65d2ae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm
new file mode 100644
index 0000000..57a52f3
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_65d2ae "countOneBits_65d2ae"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %12 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+%countOneBits_65d2ae = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %12
+ %9 = OpBitCount %v3int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_65d2ae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_65d2ae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_65d2ae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl
new file mode 100644
index 0000000..209dc7a
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_65d2ae() {
+ var res : vec3<i32> = countOneBits(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_65d2ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_65d2ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_65d2ae();
+}
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl
new file mode 100644
index 0000000..f96143b
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_690cfc() {
+ var res: vec3<u32> = countOneBits(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_690cfc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_690cfc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_690cfc();
+}
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl
new file mode 100644
index 0000000..be66422
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_690cfc() {
+ uint3 res = countbits(uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ countOneBits_690cfc();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_690cfc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_690cfc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl
new file mode 100644
index 0000000..fe38cf5
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_690cfc() {
+ uint3 res = popcount(uint3());
+}
+
+vertex void vertex_main() {
+ countOneBits_690cfc();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_690cfc();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_690cfc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm
new file mode 100644
index 0000000..011e903
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_690cfc "countOneBits_690cfc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %12 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+%countOneBits_690cfc = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %12
+ %9 = OpBitCount %v3uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_690cfc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_690cfc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_690cfc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl
new file mode 100644
index 0000000..3ac5ddb
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_690cfc() {
+ var res : vec3<u32> = countOneBits(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_690cfc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_690cfc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_690cfc();
+}
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl
new file mode 100644
index 0000000..368f3ea
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_94fd81() {
+ var res: vec2<u32> = countOneBits(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_94fd81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_94fd81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_94fd81();
+}
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl
new file mode 100644
index 0000000..547cdad
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_94fd81() {
+ uint2 res = countbits(uint2(0u, 0u));
+}
+
+void vertex_main() {
+ countOneBits_94fd81();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_94fd81();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_94fd81();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl
new file mode 100644
index 0000000..8f12412
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_94fd81() {
+ uint2 res = popcount(uint2());
+}
+
+vertex void vertex_main() {
+ countOneBits_94fd81();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_94fd81();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_94fd81();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm
new file mode 100644
index 0000000..d388650
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_94fd81 "countOneBits_94fd81"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %12 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+%countOneBits_94fd81 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %12
+ %9 = OpBitCount %v2uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_94fd81
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_94fd81
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_94fd81
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl
new file mode 100644
index 0000000..69fa22d
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_94fd81() {
+ var res : vec2<u32> = countOneBits(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_94fd81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_94fd81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_94fd81();
+}
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl
new file mode 100644
index 0000000..ab447ca
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_ae44f9() {
+ var res: u32 = countOneBits(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_ae44f9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_ae44f9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_ae44f9();
+}
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl
new file mode 100644
index 0000000..a9eebc6
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_ae44f9() {
+ uint res = countbits(1u);
+}
+
+void vertex_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl
new file mode 100644
index 0000000..4313675
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_ae44f9() {
+ uint res = popcount(1u);
+}
+
+vertex void vertex_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_ae44f9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm
new file mode 100644
index 0000000..70edbdf
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_ae44f9 "countOneBits_ae44f9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %14 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%countOneBits_ae44f9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %14
+ %9 = OpBitCount %uint %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_ae44f9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_ae44f9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_ae44f9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl
new file mode 100644
index 0000000..323ceab
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_ae44f9() {
+ var res : u32 = countOneBits(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_ae44f9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_ae44f9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_ae44f9();
+}
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl
new file mode 100644
index 0000000..d6afd81
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_af90e2() {
+ var res: vec2<i32> = countOneBits(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_af90e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_af90e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_af90e2();
+}
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl
new file mode 100644
index 0000000..a3c0bca
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_af90e2() {
+ int2 res = countbits(int2(0, 0));
+}
+
+void vertex_main() {
+ countOneBits_af90e2();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_af90e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_af90e2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl
new file mode 100644
index 0000000..0c0e24b
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_af90e2() {
+ int2 res = popcount(int2());
+}
+
+vertex void vertex_main() {
+ countOneBits_af90e2();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_af90e2();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_af90e2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm
new file mode 100644
index 0000000..1f79a2a
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_af90e2 "countOneBits_af90e2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %12 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+%countOneBits_af90e2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %12
+ %9 = OpBitCount %v2int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_af90e2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_af90e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_af90e2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f7759d
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_af90e2() {
+ var res : vec2<i32> = countOneBits(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_af90e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_af90e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_af90e2();
+}
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl
new file mode 100644
index 0000000..c271a37
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn countOneBits_fd88b2() {
+ var res: i32 = countOneBits(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_fd88b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_fd88b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_fd88b2();
+}
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl
new file mode 100644
index 0000000..be5f778
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void countOneBits_fd88b2() {
+ int res = countbits(1);
+}
+
+void vertex_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
+void fragment_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl
new file mode 100644
index 0000000..87cbb5c
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void countOneBits_fd88b2() {
+ int res = popcount(1);
+}
+
+vertex void vertex_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
+fragment void fragment_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
+kernel void compute_main() {
+ countOneBits_fd88b2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm
new file mode 100644
index 0000000..32fdbfe
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %countOneBits_fd88b2 "countOneBits_fd88b2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %14 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%countOneBits_fd88b2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %14
+ %9 = OpBitCount %int %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %countOneBits_fd88b2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %countOneBits_fd88b2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %countOneBits_fd88b2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl
new file mode 100644
index 0000000..9e6e9e8
--- /dev/null
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn countOneBits_fd88b2() {
+ var res : i32 = countOneBits(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ countOneBits_fd88b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ countOneBits_fd88b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ countOneBits_fd88b2();
+}
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl
new file mode 100644
index 0000000..e2f5ddd
--- /dev/null
+++ b/test/intrinsics/gen/cross/041cb0.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn cross_041cb0() {
+ var res: vec3<f32> = cross(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cross_041cb0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cross_041cb0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cross_041cb0();
+}
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl
new file mode 100644
index 0000000..59be0e9
--- /dev/null
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void cross_041cb0() {
+ float3 res = cross(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ cross_041cb0();
+ return;
+}
+
+void fragment_main() {
+ cross_041cb0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ cross_041cb0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl
new file mode 100644
index 0000000..fc8f311
--- /dev/null
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void cross_041cb0() {
+ float3 res = cross(float3(), float3());
+}
+
+vertex void vertex_main() {
+ cross_041cb0();
+ return;
+}
+
+fragment void fragment_main() {
+ cross_041cb0();
+ return;
+}
+
+kernel void compute_main() {
+ cross_041cb0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm
new file mode 100644
index 0000000..e14592e
--- /dev/null
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %cross_041cb0 "cross_041cb0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%cross_041cb0 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Cross %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %cross_041cb0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %cross_041cb0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %cross_041cb0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef4b20f
--- /dev/null
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn cross_041cb0() {
+ var res : vec3<f32> = cross(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ cross_041cb0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ cross_041cb0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ cross_041cb0();
+}
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl
new file mode 100644
index 0000000..1b4b85d
--- /dev/null
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn determinant_2b62ba() {
+ var res: f32 = determinant(mat3x3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_2b62ba();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_2b62ba();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_2b62ba();
+}
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl
new file mode 100644
index 0000000..45e0cf8
--- /dev/null
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void determinant_2b62ba() {
+ float res = determinant(float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ determinant_2b62ba();
+ return;
+}
+
+void fragment_main() {
+ determinant_2b62ba();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ determinant_2b62ba();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl
new file mode 100644
index 0000000..22bfd58
--- /dev/null
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_2b62ba() {
+ float res = determinant(float3x3());
+}
+
+vertex void vertex_main() {
+ determinant_2b62ba();
+ return;
+}
+
+fragment void fragment_main() {
+ determinant_2b62ba();
+ return;
+}
+
+kernel void compute_main() {
+ determinant_2b62ba();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm
new file mode 100644
index 0000000..763032a
--- /dev/null
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %determinant_2b62ba "determinant_2b62ba"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%mat3v3float = OpTypeMatrix %v3float 3
+ %13 = OpConstantNull %mat3v3float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%determinant_2b62ba = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Determinant %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %determinant_2b62ba
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %determinant_2b62ba
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %determinant_2b62ba
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c79f28
--- /dev/null
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn determinant_2b62ba() {
+ var res : f32 = determinant(mat3x3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_2b62ba();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_2b62ba();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_2b62ba();
+}
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl
new file mode 100644
index 0000000..d4d4a11
--- /dev/null
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn determinant_a0a87c() {
+ var res: f32 = determinant(mat4x4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_a0a87c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_a0a87c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_a0a87c();
+}
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl
new file mode 100644
index 0000000..83bb751
--- /dev/null
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void determinant_a0a87c() {
+ float res = determinant(float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ determinant_a0a87c();
+ return;
+}
+
+void fragment_main() {
+ determinant_a0a87c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ determinant_a0a87c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl
new file mode 100644
index 0000000..0d17e9c
--- /dev/null
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_a0a87c() {
+ float res = determinant(float4x4());
+}
+
+vertex void vertex_main() {
+ determinant_a0a87c();
+ return;
+}
+
+fragment void fragment_main() {
+ determinant_a0a87c();
+ return;
+}
+
+kernel void compute_main() {
+ determinant_a0a87c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm
new file mode 100644
index 0000000..44b6875
--- /dev/null
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %determinant_a0a87c "determinant_a0a87c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+%mat4v4float = OpTypeMatrix %v4float 4
+ %13 = OpConstantNull %mat4v4float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%determinant_a0a87c = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Determinant %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %determinant_a0a87c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %determinant_a0a87c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %determinant_a0a87c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl
new file mode 100644
index 0000000..402650f
--- /dev/null
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn determinant_a0a87c() {
+ var res : f32 = determinant(mat4x4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_a0a87c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_a0a87c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_a0a87c();
+}
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl
new file mode 100644
index 0000000..96a1fe0
--- /dev/null
+++ b/test/intrinsics/gen/determinant/e19305.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn determinant_e19305() {
+ var res: f32 = determinant(mat2x2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_e19305();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_e19305();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_e19305();
+}
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl
new file mode 100644
index 0000000..90295a3
--- /dev/null
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void determinant_e19305() {
+ float res = determinant(float2x2(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ determinant_e19305();
+ return;
+}
+
+void fragment_main() {
+ determinant_e19305();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ determinant_e19305();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl
new file mode 100644
index 0000000..22919d4
--- /dev/null
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_e19305() {
+ float res = determinant(float2x2());
+}
+
+vertex void vertex_main() {
+ determinant_e19305();
+ return;
+}
+
+fragment void fragment_main() {
+ determinant_e19305();
+ return;
+}
+
+kernel void compute_main() {
+ determinant_e19305();
+ return;
+}
+
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm
new file mode 100644
index 0000000..80a1ded
--- /dev/null
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %determinant_e19305 "determinant_e19305"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%mat2v2float = OpTypeMatrix %v2float 2
+ %13 = OpConstantNull %mat2v2float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%determinant_e19305 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Determinant %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %determinant_e19305
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %determinant_e19305
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %determinant_e19305
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5cbf33
--- /dev/null
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn determinant_e19305() {
+ var res : f32 = determinant(mat2x2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ determinant_e19305();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ determinant_e19305();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ determinant_e19305();
+}
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl
new file mode 100644
index 0000000..065497d
--- /dev/null
+++ b/test/intrinsics/gen/distance/0657d4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn distance_0657d4() {
+ var res: f32 = distance(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_0657d4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_0657d4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_0657d4();
+}
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl
new file mode 100644
index 0000000..3237591
--- /dev/null
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void distance_0657d4() {
+ float res = distance(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ distance_0657d4();
+ return;
+}
+
+void fragment_main() {
+ distance_0657d4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ distance_0657d4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl
new file mode 100644
index 0000000..5281fa5
--- /dev/null
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void distance_0657d4() {
+ float res = distance(float3(), float3());
+}
+
+vertex void vertex_main() {
+ distance_0657d4();
+ return;
+}
+
+fragment void fragment_main() {
+ distance_0657d4();
+ return;
+}
+
+kernel void compute_main() {
+ distance_0657d4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm
new file mode 100644
index 0000000..510e6bb
--- /dev/null
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %distance_0657d4 "distance_0657d4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%distance_0657d4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Distance %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %distance_0657d4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %distance_0657d4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %distance_0657d4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl
new file mode 100644
index 0000000..314378f
--- /dev/null
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn distance_0657d4() {
+ var res : f32 = distance(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_0657d4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_0657d4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_0657d4();
+}
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl
new file mode 100644
index 0000000..9f4e7b1
--- /dev/null
+++ b/test/intrinsics/gen/distance/9646ea.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn distance_9646ea() {
+ var res: f32 = distance(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_9646ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_9646ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_9646ea();
+}
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl
new file mode 100644
index 0000000..f873195
--- /dev/null
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void distance_9646ea() {
+ float res = distance(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ distance_9646ea();
+ return;
+}
+
+void fragment_main() {
+ distance_9646ea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ distance_9646ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl
new file mode 100644
index 0000000..32611cd
--- /dev/null
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void distance_9646ea() {
+ float res = distance(float4(), float4());
+}
+
+vertex void vertex_main() {
+ distance_9646ea();
+ return;
+}
+
+fragment void fragment_main() {
+ distance_9646ea();
+ return;
+}
+
+kernel void compute_main() {
+ distance_9646ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm
new file mode 100644
index 0000000..d034af5
--- /dev/null
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %distance_9646ea "distance_9646ea"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%distance_9646ea = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Distance %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %distance_9646ea
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %distance_9646ea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %distance_9646ea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl
new file mode 100644
index 0000000..39fe3d2
--- /dev/null
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn distance_9646ea() {
+ var res : f32 = distance(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_9646ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_9646ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_9646ea();
+}
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl
new file mode 100644
index 0000000..8e8387a
--- /dev/null
+++ b/test/intrinsics/gen/distance/aa4055.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn distance_aa4055() {
+ var res: f32 = distance(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_aa4055();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_aa4055();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_aa4055();
+}
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl
new file mode 100644
index 0000000..3f7e5a8
--- /dev/null
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void distance_aa4055() {
+ float res = distance(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ distance_aa4055();
+ return;
+}
+
+void fragment_main() {
+ distance_aa4055();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ distance_aa4055();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl
new file mode 100644
index 0000000..5f2f493
--- /dev/null
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void distance_aa4055() {
+ float res = distance(float2(), float2());
+}
+
+vertex void vertex_main() {
+ distance_aa4055();
+ return;
+}
+
+fragment void fragment_main() {
+ distance_aa4055();
+ return;
+}
+
+kernel void compute_main() {
+ distance_aa4055();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm
new file mode 100644
index 0000000..52ff97c
--- /dev/null
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %distance_aa4055 "distance_aa4055"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%distance_aa4055 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Distance %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %distance_aa4055
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %distance_aa4055
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %distance_aa4055
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6f6826
--- /dev/null
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn distance_aa4055() {
+ var res : f32 = distance(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_aa4055();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_aa4055();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_aa4055();
+}
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl
new file mode 100644
index 0000000..5fe662a
--- /dev/null
+++ b/test/intrinsics/gen/distance/cfed73.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn distance_cfed73() {
+ var res: f32 = distance(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_cfed73();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_cfed73();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_cfed73();
+}
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl
new file mode 100644
index 0000000..7a90d54
--- /dev/null
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void distance_cfed73() {
+ float res = distance(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ distance_cfed73();
+ return;
+}
+
+void fragment_main() {
+ distance_cfed73();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ distance_cfed73();
+ return;
+}
+
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl
new file mode 100644
index 0000000..401e6d8
--- /dev/null
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl
@@ -0,0 +1,50 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void distance_cfed73() {
+ float res = distance(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ distance_cfed73();
+ return;
+}
+
+fragment void fragment_main() {
+ distance_cfed73();
+ return;
+}
+
+kernel void compute_main() {
+ distance_cfed73();
+ return;
+}
+
+
+tint_1oo4q6.metal:5:17: error: call to 'distance' is ambiguous
+ float res = distance(1.0f, 1.0f);
+ ^~~~~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:303:17: note: candidate function
+METAL_FUNC half distance(half2 x, half2 y)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:334:17: note: candidate function
+METAL_FUNC half distance(half3 x, half3 y)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:365:17: note: candidate function
+METAL_FUNC half distance(half4 x, half4 y)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:404:18: note: candidate function
+METAL_FUNC float distance(float2 x, float2 y)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:447:18: note: candidate function
+METAL_FUNC float distance(float3 x, float3 y)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:490:18: note: candidate function
+METAL_FUNC float distance(float4 x, float4 y)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm
new file mode 100644
index 0000000..29c44fb
--- /dev/null
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %distance_cfed73 "distance_cfed73"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%distance_cfed73 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Distance %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %distance_cfed73
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %distance_cfed73
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %distance_cfed73
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff76b9d
--- /dev/null
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn distance_cfed73() {
+ var res : f32 = distance(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ distance_cfed73();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ distance_cfed73();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ distance_cfed73();
+}
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl
new file mode 100644
index 0000000..7d32e31
--- /dev/null
+++ b/test/intrinsics/gen/dot/0c577b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dot_0c577b() {
+ var res: f32 = dot(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_0c577b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_0c577b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_0c577b();
+}
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl
new file mode 100644
index 0000000..2736edd
--- /dev/null
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void dot_0c577b() {
+ float res = dot(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ dot_0c577b();
+ return;
+}
+
+void fragment_main() {
+ dot_0c577b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_0c577b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl
new file mode 100644
index 0000000..3758c7f
--- /dev/null
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_0c577b() {
+ float res = dot(float4(), float4());
+}
+
+vertex void vertex_main() {
+ dot_0c577b();
+ return;
+}
+
+fragment void fragment_main() {
+ dot_0c577b();
+ return;
+}
+
+kernel void compute_main() {
+ dot_0c577b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm
new file mode 100644
index 0000000..37383ec
--- /dev/null
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %dot_0c577b "dot_0c577b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %11 = OpConstantNull %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+ %dot_0c577b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpDot %float %11 %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %dot_0c577b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %dot_0c577b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %dot_0c577b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl
new file mode 100644
index 0000000..09912d6
--- /dev/null
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn dot_0c577b() {
+ var res : f32 = dot(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_0c577b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_0c577b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_0c577b();
+}
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl
new file mode 100644
index 0000000..74c9ab7
--- /dev/null
+++ b/test/intrinsics/gen/dot/883f0e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dot_883f0e() {
+ var res: f32 = dot(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_883f0e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_883f0e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_883f0e();
+}
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl
new file mode 100644
index 0000000..c72475a
--- /dev/null
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void dot_883f0e() {
+ float res = dot(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ dot_883f0e();
+ return;
+}
+
+void fragment_main() {
+ dot_883f0e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_883f0e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl
new file mode 100644
index 0000000..260fee3
--- /dev/null
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_883f0e() {
+ float res = dot(float2(), float2());
+}
+
+vertex void vertex_main() {
+ dot_883f0e();
+ return;
+}
+
+fragment void fragment_main() {
+ dot_883f0e();
+ return;
+}
+
+kernel void compute_main() {
+ dot_883f0e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm
new file mode 100644
index 0000000..7f313bf
--- /dev/null
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %dot_883f0e "dot_883f0e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %11 = OpConstantNull %v2float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+ %dot_883f0e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpDot %float %11 %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %dot_883f0e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %dot_883f0e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %dot_883f0e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl
new file mode 100644
index 0000000..e0cfc73
--- /dev/null
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn dot_883f0e() {
+ var res : f32 = dot(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_883f0e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_883f0e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_883f0e();
+}
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl
new file mode 100644
index 0000000..11776b9
--- /dev/null
+++ b/test/intrinsics/gen/dot/ba4246.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dot_ba4246() {
+ var res: f32 = dot(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_ba4246();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_ba4246();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_ba4246();
+}
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl
new file mode 100644
index 0000000..aa91fe7
--- /dev/null
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void dot_ba4246() {
+ float res = dot(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ dot_ba4246();
+ return;
+}
+
+void fragment_main() {
+ dot_ba4246();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ dot_ba4246();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl
new file mode 100644
index 0000000..521557f
--- /dev/null
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dot_ba4246() {
+ float res = dot(float3(), float3());
+}
+
+vertex void vertex_main() {
+ dot_ba4246();
+ return;
+}
+
+fragment void fragment_main() {
+ dot_ba4246();
+ return;
+}
+
+kernel void compute_main() {
+ dot_ba4246();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm
new file mode 100644
index 0000000..613cb92
--- /dev/null
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %dot_ba4246 "dot_ba4246"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %11 = OpConstantNull %v3float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+ %dot_ba4246 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpDot %float %11 %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %dot_ba4246
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %dot_ba4246
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %dot_ba4246
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl
new file mode 100644
index 0000000..a17c295
--- /dev/null
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn dot_ba4246() {
+ var res : f32 = dot(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ dot_ba4246();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dot_ba4246();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ dot_ba4246();
+}
diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl b/test/intrinsics/gen/dpdx/0763f7.wgsl
new file mode 100644
index 0000000..69bc437
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/0763f7.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdx_0763f7() {
+ var res: vec3<f32> = dpdx(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_0763f7();
+}
diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl
new file mode 100644
index 0000000..1ca6ae7
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdx_0763f7() {
+ float3 res = ddx(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdx_0763f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl
new file mode 100644
index 0000000..082d924
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdx_0763f7() {
+ float3 res = dfdx(float3());
+}
+
+fragment void fragment_main() {
+ dpdx_0763f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..4a1bd28
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdx_0763f7 "dpdx_0763f7"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdx_0763f7 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdx %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdx_0763f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..be5f4e0
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdx_0763f7() {
+ var res : vec3<f32> = dpdx(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_0763f7();
+}
diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl b/test/intrinsics/gen/dpdx/99edb1.wgsl
new file mode 100644
index 0000000..552e889
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/99edb1.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdx_99edb1() {
+ var res: vec2<f32> = dpdx(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_99edb1();
+}
diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl
new file mode 100644
index 0000000..c692e09
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdx_99edb1() {
+ float2 res = ddx(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdx_99edb1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl
new file mode 100644
index 0000000..1c389c8
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdx_99edb1() {
+ float2 res = dfdx(float2());
+}
+
+fragment void fragment_main() {
+ dpdx_99edb1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm
new file mode 100644
index 0000000..7499b26
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdx_99edb1 "dpdx_99edb1"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdx_99edb1 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdx %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdx_99edb1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl
new file mode 100644
index 0000000..aafee00
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdx_99edb1() {
+ var res : vec2<f32> = dpdx(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_99edb1();
+}
diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl b/test/intrinsics/gen/dpdx/c487fa.wgsl
new file mode 100644
index 0000000..863b95d
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/c487fa.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdx_c487fa() {
+ var res: vec4<f32> = dpdx(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_c487fa();
+}
diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl
new file mode 100644
index 0000000..4b78e5b
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdx_c487fa() {
+ float4 res = ddx(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdx_c487fa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl
new file mode 100644
index 0000000..06e584f
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdx_c487fa() {
+ float4 res = dfdx(float4());
+}
+
+fragment void fragment_main() {
+ dpdx_c487fa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm
new file mode 100644
index 0000000..3065b31
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdx_c487fa "dpdx_c487fa"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdx_c487fa = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdx %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdx_c487fa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl
new file mode 100644
index 0000000..350f0c2
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdx_c487fa() {
+ var res : vec4<f32> = dpdx(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_c487fa();
+}
diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl b/test/intrinsics/gen/dpdx/e263de.wgsl
new file mode 100644
index 0000000..5317a56
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/e263de.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdx_e263de() {
+ var res: f32 = dpdx(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_e263de();
+}
diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl
new file mode 100644
index 0000000..7aced4b
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdx_e263de() {
+ float res = ddx(1.0f);
+}
+
+void fragment_main() {
+ dpdx_e263de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl
new file mode 100644
index 0000000..9a63d08
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdx_e263de() {
+ float res = dfdx(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdx_e263de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm
new file mode 100644
index 0000000..362c4c1
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdx_e263de "dpdx_e263de"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdx_e263de = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdx %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdx_e263de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl
new file mode 100644
index 0000000..03939a6
--- /dev/null
+++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdx_e263de() {
+ var res : f32 = dpdx(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdx_e263de();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl
new file mode 100644
index 0000000..cdaec0c
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxCoarse_029152() {
+ var res: f32 = dpdxCoarse(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_029152();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl
new file mode 100644
index 0000000..74a2823
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxCoarse_029152() {
+ float res = ddx_coarse(1.0f);
+}
+
+void fragment_main() {
+ dpdxCoarse_029152();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl
new file mode 100644
index 0000000..fc27f74
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxCoarse_029152() {
+ float res = dfdx(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdxCoarse_029152();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm
new file mode 100644
index 0000000..a000ab1
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxCoarse_029152 "dpdxCoarse_029152"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdxCoarse_029152 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdxCoarse %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxCoarse_029152
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f2d250
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxCoarse_029152() {
+ var res : f32 = dpdxCoarse(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_029152();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl
new file mode 100644
index 0000000..f0c72c0
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxCoarse_9581cf() {
+ var res: vec2<f32> = dpdxCoarse(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_9581cf();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl
new file mode 100644
index 0000000..dabf49e
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxCoarse_9581cf() {
+ float2 res = ddx_coarse(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxCoarse_9581cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl
new file mode 100644
index 0000000..283a082
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxCoarse_9581cf() {
+ float2 res = dfdx(float2());
+}
+
+fragment void fragment_main() {
+ dpdxCoarse_9581cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..8113530
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxCoarse_9581cf "dpdxCoarse_9581cf"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdxCoarse_9581cf = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdxCoarse %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxCoarse_9581cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..a341150
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxCoarse_9581cf() {
+ var res : vec2<f32> = dpdxCoarse(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_9581cf();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl
new file mode 100644
index 0000000..3a39911
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxCoarse_c28641() {
+ var res: vec4<f32> = dpdxCoarse(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_c28641();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl
new file mode 100644
index 0000000..8ad91d2
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxCoarse_c28641() {
+ float4 res = ddx_coarse(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxCoarse_c28641();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl
new file mode 100644
index 0000000..7134062
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxCoarse_c28641() {
+ float4 res = dfdx(float4());
+}
+
+fragment void fragment_main() {
+ dpdxCoarse_c28641();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm
new file mode 100644
index 0000000..fbf6337
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxCoarse_c28641 "dpdxCoarse_c28641"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdxCoarse_c28641 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdxCoarse %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxCoarse_c28641
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl
new file mode 100644
index 0000000..17c714b
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxCoarse_c28641() {
+ var res : vec4<f32> = dpdxCoarse(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_c28641();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl
new file mode 100644
index 0000000..7cf90a9
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxCoarse_f64d7b() {
+ var res: vec3<f32> = dpdxCoarse(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_f64d7b();
+}
diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl
new file mode 100644
index 0000000..e73fe4b
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxCoarse_f64d7b() {
+ float3 res = ddx_coarse(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxCoarse_f64d7b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl
new file mode 100644
index 0000000..e04364e
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxCoarse_f64d7b() {
+ float3 res = dfdx(float3());
+}
+
+fragment void fragment_main() {
+ dpdxCoarse_f64d7b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm
new file mode 100644
index 0000000..86b0628
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxCoarse_f64d7b "dpdxCoarse_f64d7b"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdxCoarse_f64d7b = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdxCoarse %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxCoarse_f64d7b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl
new file mode 100644
index 0000000..6182abe
--- /dev/null
+++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxCoarse_f64d7b() {
+ var res : vec3<f32> = dpdxCoarse(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxCoarse_f64d7b();
+}
diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl
new file mode 100644
index 0000000..3230463
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxFine_8c5069() {
+ var res: vec4<f32> = dpdxFine(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_8c5069();
+}
diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl
new file mode 100644
index 0000000..28414bb
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxFine_8c5069() {
+ float4 res = ddx_fine(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxFine_8c5069();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl
new file mode 100644
index 0000000..c4a18ed
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxFine_8c5069() {
+ float4 res = dfdx(float4());
+}
+
+fragment void fragment_main() {
+ dpdxFine_8c5069();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm
new file mode 100644
index 0000000..318a5ce
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxFine_8c5069 "dpdxFine_8c5069"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdxFine_8c5069 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdxFine %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxFine_8c5069
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl
new file mode 100644
index 0000000..a83e763
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxFine_8c5069() {
+ var res : vec4<f32> = dpdxFine(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_8c5069();
+}
diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl
new file mode 100644
index 0000000..3173662
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxFine_9631de() {
+ var res: vec2<f32> = dpdxFine(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_9631de();
+}
diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl
new file mode 100644
index 0000000..2aee38d
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxFine_9631de() {
+ float2 res = ddx_fine(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxFine_9631de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl
new file mode 100644
index 0000000..be6ed51
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxFine_9631de() {
+ float2 res = dfdx(float2());
+}
+
+fragment void fragment_main() {
+ dpdxFine_9631de();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm
new file mode 100644
index 0000000..f015eb4
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxFine_9631de "dpdxFine_9631de"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdxFine_9631de = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdxFine %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxFine_9631de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl
new file mode 100644
index 0000000..002e44e
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxFine_9631de() {
+ var res : vec2<f32> = dpdxFine(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_9631de();
+}
diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl
new file mode 100644
index 0000000..35481d2
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxFine_f401a2() {
+ var res: f32 = dpdxFine(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_f401a2();
+}
diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl
new file mode 100644
index 0000000..badad66
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxFine_f401a2() {
+ float res = ddx_fine(1.0f);
+}
+
+void fragment_main() {
+ dpdxFine_f401a2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl
new file mode 100644
index 0000000..b618db9
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxFine_f401a2() {
+ float res = dfdx(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdxFine_f401a2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm
new file mode 100644
index 0000000..24fd696
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxFine_f401a2 "dpdxFine_f401a2"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdxFine_f401a2 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdxFine %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxFine_f401a2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl
new file mode 100644
index 0000000..2790d8d
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxFine_f401a2() {
+ var res : f32 = dpdxFine(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_f401a2();
+}
diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl
new file mode 100644
index 0000000..36663ae
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdxFine_f92fb6() {
+ var res: vec3<f32> = dpdxFine(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_f92fb6();
+}
diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl
new file mode 100644
index 0000000..d8e8840
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdxFine_f92fb6() {
+ float3 res = ddx_fine(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdxFine_f92fb6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl
new file mode 100644
index 0000000..f19db09
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdxFine_f92fb6() {
+ float3 res = dfdx(float3());
+}
+
+fragment void fragment_main() {
+ dpdxFine_f92fb6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm
new file mode 100644
index 0000000..cdc8be2
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdxFine_f92fb6 "dpdxFine_f92fb6"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdxFine_f92fb6 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdxFine %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdxFine_f92fb6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl
new file mode 100644
index 0000000..a40c3fb
--- /dev/null
+++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdxFine_f92fb6() {
+ var res : vec3<f32> = dpdxFine(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdxFine_f92fb6();
+}
diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl b/test/intrinsics/gen/dpdy/699a05.wgsl
new file mode 100644
index 0000000..f3279e4
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/699a05.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdy_699a05() {
+ var res: vec4<f32> = dpdy(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_699a05();
+}
diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl
new file mode 100644
index 0000000..e1d5f33
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdy_699a05() {
+ float4 res = ddy(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdy_699a05();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl
new file mode 100644
index 0000000..9a2a776
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdy_699a05() {
+ float4 res = dfdy(float4());
+}
+
+fragment void fragment_main() {
+ dpdy_699a05();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm
new file mode 100644
index 0000000..b135d44
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdy_699a05 "dpdy_699a05"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdy_699a05 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdy %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdy_699a05
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl
new file mode 100644
index 0000000..5be383d
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdy_699a05() {
+ var res : vec4<f32> = dpdy(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_699a05();
+}
diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl
new file mode 100644
index 0000000..6a61aac
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdy_7f8d84() {
+ var res: f32 = dpdy(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_7f8d84();
+}
diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl
new file mode 100644
index 0000000..2b98417
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdy_7f8d84() {
+ float res = ddy(1.0f);
+}
+
+void fragment_main() {
+ dpdy_7f8d84();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl
new file mode 100644
index 0000000..5efaf9e
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdy_7f8d84() {
+ float res = dfdy(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdy_7f8d84();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm
new file mode 100644
index 0000000..9283881
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdy_7f8d84 "dpdy_7f8d84"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdy_7f8d84 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdy %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdy_7f8d84
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl
new file mode 100644
index 0000000..9d96009
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdy_7f8d84() {
+ var res : f32 = dpdy(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_7f8d84();
+}
diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl
new file mode 100644
index 0000000..b01eeb1
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdy_a8b56e() {
+ var res: vec2<f32> = dpdy(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_a8b56e();
+}
diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl
new file mode 100644
index 0000000..fb8f848
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdy_a8b56e() {
+ float2 res = ddy(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdy_a8b56e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl
new file mode 100644
index 0000000..74fa551
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdy_a8b56e() {
+ float2 res = dfdy(float2());
+}
+
+fragment void fragment_main() {
+ dpdy_a8b56e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm
new file mode 100644
index 0000000..039cac5
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdy_a8b56e "dpdy_a8b56e"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdy_a8b56e = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdy %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdy_a8b56e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl
new file mode 100644
index 0000000..bfe028f
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdy_a8b56e() {
+ var res : vec2<f32> = dpdy(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_a8b56e();
+}
diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl b/test/intrinsics/gen/dpdy/feb40f.wgsl
new file mode 100644
index 0000000..f4c2d0b
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/feb40f.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdy_feb40f() {
+ var res: vec3<f32> = dpdy(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_feb40f();
+}
diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl
new file mode 100644
index 0000000..be1091c
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdy_feb40f() {
+ float3 res = ddy(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdy_feb40f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl
new file mode 100644
index 0000000..5c4fdf7
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdy_feb40f() {
+ float3 res = dfdy(float3());
+}
+
+fragment void fragment_main() {
+ dpdy_feb40f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm
new file mode 100644
index 0000000..47765fe
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm
@@ -0,0 +1,30 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdy_feb40f "dpdy_feb40f"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdy_feb40f = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdy %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdy_feb40f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl
new file mode 100644
index 0000000..f75381c
--- /dev/null
+++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdy_feb40f() {
+ var res : vec3<f32> = dpdy(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdy_feb40f();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl
new file mode 100644
index 0000000..6ccebca
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyCoarse_3e1ab4() {
+ var res: vec2<f32> = dpdyCoarse(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_3e1ab4();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl
new file mode 100644
index 0000000..ea55628
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyCoarse_3e1ab4() {
+ float2 res = ddy_coarse(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyCoarse_3e1ab4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl
new file mode 100644
index 0000000..55be7be
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyCoarse_3e1ab4() {
+ float2 res = dfdy(float2());
+}
+
+fragment void fragment_main() {
+ dpdyCoarse_3e1ab4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
new file mode 100644
index 0000000..8a004f9
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyCoarse_3e1ab4 "dpdyCoarse_3e1ab4"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdyCoarse_3e1ab4 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdyCoarse %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyCoarse_3e1ab4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
new file mode 100644
index 0000000..d109629
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyCoarse_3e1ab4() {
+ var res : vec2<f32> = dpdyCoarse(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_3e1ab4();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl
new file mode 100644
index 0000000..b2e958c
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyCoarse_445d24() {
+ var res: vec4<f32> = dpdyCoarse(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_445d24();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl
new file mode 100644
index 0000000..09f3ea5
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyCoarse_445d24() {
+ float4 res = ddy_coarse(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyCoarse_445d24();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl
new file mode 100644
index 0000000..32038dd
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyCoarse_445d24() {
+ float4 res = dfdy(float4());
+}
+
+fragment void fragment_main() {
+ dpdyCoarse_445d24();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a04611
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyCoarse_445d24 "dpdyCoarse_445d24"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdyCoarse_445d24 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdyCoarse %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyCoarse_445d24
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5659f6
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyCoarse_445d24() {
+ var res : vec4<f32> = dpdyCoarse(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_445d24();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl
new file mode 100644
index 0000000..9a94190
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyCoarse_870a7e() {
+ var res: f32 = dpdyCoarse(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_870a7e();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl
new file mode 100644
index 0000000..3d181a4
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyCoarse_870a7e() {
+ float res = ddy_coarse(1.0f);
+}
+
+void fragment_main() {
+ dpdyCoarse_870a7e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl
new file mode 100644
index 0000000..42c9c5d
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyCoarse_870a7e() {
+ float res = dfdy(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdyCoarse_870a7e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm
new file mode 100644
index 0000000..81b17f0
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyCoarse_870a7e "dpdyCoarse_870a7e"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdyCoarse_870a7e = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdyCoarse %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyCoarse_870a7e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl
new file mode 100644
index 0000000..1bf505f
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyCoarse_870a7e() {
+ var res : f32 = dpdyCoarse(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_870a7e();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl
new file mode 100644
index 0000000..2791802
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyCoarse_ae1873() {
+ var res: vec3<f32> = dpdyCoarse(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_ae1873();
+}
diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl
new file mode 100644
index 0000000..2f6b6ac
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyCoarse_ae1873() {
+ float3 res = ddy_coarse(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyCoarse_ae1873();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl
new file mode 100644
index 0000000..9f1ea7f
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyCoarse_ae1873() {
+ float3 res = dfdy(float3());
+}
+
+fragment void fragment_main() {
+ dpdyCoarse_ae1873();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm
new file mode 100644
index 0000000..f6c84c2
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyCoarse_ae1873 "dpdyCoarse_ae1873"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdyCoarse_ae1873 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdyCoarse %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyCoarse_ae1873
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl
new file mode 100644
index 0000000..e625403
--- /dev/null
+++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyCoarse_ae1873() {
+ var res : vec3<f32> = dpdyCoarse(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyCoarse_ae1873();
+}
diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl
new file mode 100644
index 0000000..9bfe290
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyFine_1fb7ab() {
+ var res: vec3<f32> = dpdyFine(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_1fb7ab();
+}
diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl
new file mode 100644
index 0000000..e9ea642
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyFine_1fb7ab() {
+ float3 res = ddy_fine(float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyFine_1fb7ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl
new file mode 100644
index 0000000..bc48a42
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyFine_1fb7ab() {
+ float3 res = dfdy(float3());
+}
+
+fragment void fragment_main() {
+ dpdyFine_1fb7ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..30c1c86
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyFine_1fb7ab "dpdyFine_1fb7ab"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %8 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+%dpdyFine_1fb7ab = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %8
+ %5 = OpDPdyFine %v3float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyFine_1fb7ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..852459c
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyFine_1fb7ab() {
+ var res : vec3<f32> = dpdyFine(vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_1fb7ab();
+}
diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl
new file mode 100644
index 0000000..f9e7a69
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyFine_6eb673() {
+ var res: f32 = dpdyFine(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_6eb673();
+}
diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl
new file mode 100644
index 0000000..678b56f
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyFine_6eb673() {
+ float res = ddy_fine(1.0f);
+}
+
+void fragment_main() {
+ dpdyFine_6eb673();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl
new file mode 100644
index 0000000..a30960e
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyFine_6eb673() {
+ float res = dfdy(1.0f);
+}
+
+fragment void fragment_main() {
+ dpdyFine_6eb673();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm
new file mode 100644
index 0000000..1656762
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyFine_6eb673 "dpdyFine_6eb673"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %10 = OpConstantNull %float
+%dpdyFine_6eb673 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %10
+ %5 = OpDPdyFine %float %float_1
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyFine_6eb673
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl
new file mode 100644
index 0000000..60caecd
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyFine_6eb673() {
+ var res : f32 = dpdyFine(1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_6eb673();
+}
diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl
new file mode 100644
index 0000000..a12eb76
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyFine_d0a648() {
+ var res: vec4<f32> = dpdyFine(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_d0a648();
+}
diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl
new file mode 100644
index 0000000..81163cb
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyFine_d0a648() {
+ float4 res = ddy_fine(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyFine_d0a648();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl
new file mode 100644
index 0000000..93ecdf6
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyFine_d0a648() {
+ float4 res = dfdy(float4());
+}
+
+fragment void fragment_main() {
+ dpdyFine_d0a648();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm
new file mode 100644
index 0000000..16a8927
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyFine_d0a648 "dpdyFine_d0a648"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %8 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%dpdyFine_d0a648 = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %5 = OpDPdyFine %v4float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyFine_d0a648
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl
new file mode 100644
index 0000000..160b27b
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyFine_d0a648() {
+ var res : vec4<f32> = dpdyFine(vec4<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_d0a648();
+}
diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl
new file mode 100644
index 0000000..e9a892d
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn dpdyFine_df33aa() {
+ var res: vec2<f32> = dpdyFine(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_df33aa();
+}
diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl
new file mode 100644
index 0000000..62cae74
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl
@@ -0,0 +1,9 @@
+void dpdyFine_df33aa() {
+ float2 res = ddy_fine(float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ dpdyFine_df33aa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl
new file mode 100644
index 0000000..a8dcab8
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void dpdyFine_df33aa() {
+ float2 res = dfdy(float2());
+}
+
+fragment void fragment_main() {
+ dpdyFine_df33aa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d5346e
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm
@@ -0,0 +1,31 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 14
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %dpdyFine_df33aa "dpdyFine_df33aa"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %8 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%dpdyFine_df33aa = OpFunction %void None %1
+ %4 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %8
+ %5 = OpDPdyFine %v2float %8
+ OpStore %res %5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %1
+ %12 = OpLabel
+ %13 = OpFunctionCall %void %dpdyFine_df33aa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl
new file mode 100644
index 0000000..b541ecf
--- /dev/null
+++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn dpdyFine_df33aa() {
+ var res : vec2<f32> = dpdyFine(vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ dpdyFine_df33aa();
+}
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl
new file mode 100644
index 0000000..a5de8fe
--- /dev/null
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp_0f70eb() {
+ var res: vec4<f32> = exp(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_0f70eb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_0f70eb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_0f70eb();
+}
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl
new file mode 100644
index 0000000..2739620
--- /dev/null
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp_0f70eb() {
+ float4 res = exp(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp_0f70eb();
+ return;
+}
+
+void fragment_main() {
+ exp_0f70eb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp_0f70eb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl
new file mode 100644
index 0000000..f019d60
--- /dev/null
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp_0f70eb() {
+ float4 res = exp(float4());
+}
+
+vertex void vertex_main() {
+ exp_0f70eb();
+ return;
+}
+
+fragment void fragment_main() {
+ exp_0f70eb();
+ return;
+}
+
+kernel void compute_main() {
+ exp_0f70eb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm
new file mode 100644
index 0000000..f331531
--- /dev/null
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp_0f70eb "exp_0f70eb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %exp_0f70eb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Exp %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp_0f70eb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp_0f70eb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp_0f70eb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcd1bf3
--- /dev/null
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp_0f70eb() {
+ var res : vec4<f32> = exp(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_0f70eb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_0f70eb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_0f70eb();
+}
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl
new file mode 100644
index 0000000..4377980
--- /dev/null
+++ b/test/intrinsics/gen/exp/1951e7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp_1951e7() {
+ var res: vec2<f32> = exp(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_1951e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_1951e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_1951e7();
+}
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..a58d3e9
--- /dev/null
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp_1951e7() {
+ float2 res = exp(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp_1951e7();
+ return;
+}
+
+void fragment_main() {
+ exp_1951e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp_1951e7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl
new file mode 100644
index 0000000..298ce08
--- /dev/null
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp_1951e7() {
+ float2 res = exp(float2());
+}
+
+vertex void vertex_main() {
+ exp_1951e7();
+ return;
+}
+
+fragment void fragment_main() {
+ exp_1951e7();
+ return;
+}
+
+kernel void compute_main() {
+ exp_1951e7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..61f4ab3
--- /dev/null
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp_1951e7 "exp_1951e7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %exp_1951e7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Exp %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp_1951e7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp_1951e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp_1951e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..3457951
--- /dev/null
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp_1951e7() {
+ var res : vec2<f32> = exp(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_1951e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_1951e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_1951e7();
+}
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl
new file mode 100644
index 0000000..6138fb4
--- /dev/null
+++ b/test/intrinsics/gen/exp/771fd2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp_771fd2() {
+ var res: f32 = exp(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_771fd2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_771fd2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_771fd2();
+}
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl
new file mode 100644
index 0000000..8c34c09
--- /dev/null
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp_771fd2() {
+ float res = exp(1.0f);
+}
+
+void vertex_main() {
+ exp_771fd2();
+ return;
+}
+
+void fragment_main() {
+ exp_771fd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp_771fd2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl
new file mode 100644
index 0000000..17e6c84
--- /dev/null
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp_771fd2() {
+ float res = exp(1.0f);
+}
+
+vertex void vertex_main() {
+ exp_771fd2();
+ return;
+}
+
+fragment void fragment_main() {
+ exp_771fd2();
+ return;
+}
+
+kernel void compute_main() {
+ exp_771fd2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm
new file mode 100644
index 0000000..cbfdf1c
--- /dev/null
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp_771fd2 "exp_771fd2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %exp_771fd2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Exp %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %exp_771fd2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %exp_771fd2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %exp_771fd2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl
new file mode 100644
index 0000000..ca36b2c
--- /dev/null
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp_771fd2() {
+ var res : f32 = exp(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_771fd2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_771fd2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_771fd2();
+}
diff --git a/test/intrinsics/gen/exp/d98450.wgsl b/test/intrinsics/gen/exp/d98450.wgsl
new file mode 100644
index 0000000..754d43a
--- /dev/null
+++ b/test/intrinsics/gen/exp/d98450.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp_d98450() {
+ var res: vec3<f32> = exp(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_d98450();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_d98450();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_d98450();
+}
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl
new file mode 100644
index 0000000..1587672
--- /dev/null
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp_d98450() {
+ float3 res = exp(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp_d98450();
+ return;
+}
+
+void fragment_main() {
+ exp_d98450();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp_d98450();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl
new file mode 100644
index 0000000..7e0df49
--- /dev/null
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp_d98450() {
+ float3 res = exp(float3());
+}
+
+vertex void vertex_main() {
+ exp_d98450();
+ return;
+}
+
+fragment void fragment_main() {
+ exp_d98450();
+ return;
+}
+
+kernel void compute_main() {
+ exp_d98450();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm
new file mode 100644
index 0000000..45cdde1
--- /dev/null
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp_d98450 "exp_d98450"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %exp_d98450 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Exp %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp_d98450
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp_d98450
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp_d98450
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl
new file mode 100644
index 0000000..3423169
--- /dev/null
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp_d98450() {
+ var res : vec3<f32> = exp(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp_d98450();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp_d98450();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp_d98450();
+}
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl
new file mode 100644
index 0000000..ec8cb20
--- /dev/null
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp2_1f8680() {
+ var res: vec3<f32> = exp2(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_1f8680();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_1f8680();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_1f8680();
+}
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl
new file mode 100644
index 0000000..ca91ba5
--- /dev/null
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp2_1f8680() {
+ float3 res = exp2(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp2_1f8680();
+ return;
+}
+
+void fragment_main() {
+ exp2_1f8680();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp2_1f8680();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl
new file mode 100644
index 0000000..fb80ff7
--- /dev/null
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp2_1f8680() {
+ float3 res = exp2(float3());
+}
+
+vertex void vertex_main() {
+ exp2_1f8680();
+ return;
+}
+
+fragment void fragment_main() {
+ exp2_1f8680();
+ return;
+}
+
+kernel void compute_main() {
+ exp2_1f8680();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm
new file mode 100644
index 0000000..1b944c1
--- /dev/null
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp2_1f8680 "exp2_1f8680"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%exp2_1f8680 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Exp2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp2_1f8680
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp2_1f8680
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp2_1f8680
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl
new file mode 100644
index 0000000..6d20071
--- /dev/null
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp2_1f8680() {
+ var res : vec3<f32> = exp2(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_1f8680();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_1f8680();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_1f8680();
+}
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl
new file mode 100644
index 0000000..d5e4df5
--- /dev/null
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp2_a9d0a7() {
+ var res: vec4<f32> = exp2(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_a9d0a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_a9d0a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_a9d0a7();
+}
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl
new file mode 100644
index 0000000..6dfb8b8
--- /dev/null
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp2_a9d0a7() {
+ float4 res = exp2(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp2_a9d0a7();
+ return;
+}
+
+void fragment_main() {
+ exp2_a9d0a7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp2_a9d0a7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl
new file mode 100644
index 0000000..f6114d4
--- /dev/null
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp2_a9d0a7() {
+ float4 res = exp2(float4());
+}
+
+vertex void vertex_main() {
+ exp2_a9d0a7();
+ return;
+}
+
+fragment void fragment_main() {
+ exp2_a9d0a7();
+ return;
+}
+
+kernel void compute_main() {
+ exp2_a9d0a7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm
new file mode 100644
index 0000000..6360aea
--- /dev/null
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp2_a9d0a7 "exp2_a9d0a7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%exp2_a9d0a7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Exp2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp2_a9d0a7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp2_a9d0a7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp2_a9d0a7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl
new file mode 100644
index 0000000..415b612
--- /dev/null
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp2_a9d0a7() {
+ var res : vec4<f32> = exp2(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_a9d0a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_a9d0a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_a9d0a7();
+}
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl
new file mode 100644
index 0000000..5e5cecb
--- /dev/null
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp2_d6777c() {
+ var res: vec2<f32> = exp2(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_d6777c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_d6777c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_d6777c();
+}
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl
new file mode 100644
index 0000000..1a7cb5f
--- /dev/null
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp2_d6777c() {
+ float2 res = exp2(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ exp2_d6777c();
+ return;
+}
+
+void fragment_main() {
+ exp2_d6777c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp2_d6777c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl
new file mode 100644
index 0000000..48a5a46
--- /dev/null
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp2_d6777c() {
+ float2 res = exp2(float2());
+}
+
+vertex void vertex_main() {
+ exp2_d6777c();
+ return;
+}
+
+fragment void fragment_main() {
+ exp2_d6777c();
+ return;
+}
+
+kernel void compute_main() {
+ exp2_d6777c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm
new file mode 100644
index 0000000..4667d68
--- /dev/null
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp2_d6777c "exp2_d6777c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%exp2_d6777c = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Exp2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %exp2_d6777c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %exp2_d6777c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %exp2_d6777c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl
new file mode 100644
index 0000000..189d7be
--- /dev/null
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp2_d6777c() {
+ var res : vec2<f32> = exp2(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_d6777c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_d6777c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_d6777c();
+}
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl
new file mode 100644
index 0000000..6c03918
--- /dev/null
+++ b/test/intrinsics/gen/exp2/dea523.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn exp2_dea523() {
+ var res: f32 = exp2(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_dea523();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_dea523();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_dea523();
+}
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl
new file mode 100644
index 0000000..8b75b70
--- /dev/null
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void exp2_dea523() {
+ float res = exp2(1.0f);
+}
+
+void vertex_main() {
+ exp2_dea523();
+ return;
+}
+
+void fragment_main() {
+ exp2_dea523();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ exp2_dea523();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl
new file mode 100644
index 0000000..d18c2ef
--- /dev/null
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void exp2_dea523() {
+ float res = exp2(1.0f);
+}
+
+vertex void vertex_main() {
+ exp2_dea523();
+ return;
+}
+
+fragment void fragment_main() {
+ exp2_dea523();
+ return;
+}
+
+kernel void compute_main() {
+ exp2_dea523();
+ return;
+}
+
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm
new file mode 100644
index 0000000..9ae8c98
--- /dev/null
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %exp2_dea523 "exp2_dea523"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%exp2_dea523 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Exp2 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %exp2_dea523
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %exp2_dea523
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %exp2_dea523
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl
new file mode 100644
index 0000000..136bc62
--- /dev/null
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn exp2_dea523() {
+ var res : f32 = exp2(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ exp2_dea523();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ exp2_dea523();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ exp2_dea523();
+}
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl
new file mode 100644
index 0000000..e72c377
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn faceForward_5afbd5() {
+ var res: vec3<f32> = faceForward(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_5afbd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_5afbd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_5afbd5();
+}
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl
new file mode 100644
index 0000000..9df71d6
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void faceForward_5afbd5() {
+ float3 res = faceforward(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ faceForward_5afbd5();
+ return;
+}
+
+void fragment_main() {
+ faceForward_5afbd5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ faceForward_5afbd5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl
new file mode 100644
index 0000000..4a95173
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void faceForward_5afbd5() {
+ float3 res = faceforward(float3(), float3(), float3());
+}
+
+vertex void vertex_main() {
+ faceForward_5afbd5();
+ return;
+}
+
+fragment void fragment_main() {
+ faceForward_5afbd5();
+ return;
+}
+
+kernel void compute_main() {
+ faceForward_5afbd5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm
new file mode 100644
index 0000000..90d4263
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %faceForward_5afbd5 "faceForward_5afbd5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%faceForward_5afbd5 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 FaceForward %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %faceForward_5afbd5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %faceForward_5afbd5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %faceForward_5afbd5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl
new file mode 100644
index 0000000..901d9f3
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn faceForward_5afbd5() {
+ var res : vec3<f32> = faceForward(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_5afbd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_5afbd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_5afbd5();
+}
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl
new file mode 100644
index 0000000..fb7a156
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn faceForward_b316e5() {
+ var res: vec4<f32> = faceForward(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_b316e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_b316e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_b316e5();
+}
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl
new file mode 100644
index 0000000..c02347c
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void faceForward_b316e5() {
+ float4 res = faceforward(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ faceForward_b316e5();
+ return;
+}
+
+void fragment_main() {
+ faceForward_b316e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ faceForward_b316e5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl
new file mode 100644
index 0000000..71972d7
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void faceForward_b316e5() {
+ float4 res = faceforward(float4(), float4(), float4());
+}
+
+vertex void vertex_main() {
+ faceForward_b316e5();
+ return;
+}
+
+fragment void fragment_main() {
+ faceForward_b316e5();
+ return;
+}
+
+kernel void compute_main() {
+ faceForward_b316e5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm
new file mode 100644
index 0000000..163e751
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %faceForward_b316e5 "faceForward_b316e5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%faceForward_b316e5 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 FaceForward %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %faceForward_b316e5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %faceForward_b316e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %faceForward_b316e5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl
new file mode 100644
index 0000000..904f610
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn faceForward_b316e5() {
+ var res : vec4<f32> = faceForward(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_b316e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_b316e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_b316e5();
+}
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl
new file mode 100644
index 0000000..deb3846
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn faceForward_e6908b() {
+ var res: vec2<f32> = faceForward(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_e6908b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_e6908b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_e6908b();
+}
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl
new file mode 100644
index 0000000..de0f89e
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void faceForward_e6908b() {
+ float2 res = faceforward(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ faceForward_e6908b();
+ return;
+}
+
+void fragment_main() {
+ faceForward_e6908b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ faceForward_e6908b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl
new file mode 100644
index 0000000..2cfdf0e
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void faceForward_e6908b() {
+ float2 res = faceforward(float2(), float2(), float2());
+}
+
+vertex void vertex_main() {
+ faceForward_e6908b();
+ return;
+}
+
+fragment void fragment_main() {
+ faceForward_e6908b();
+ return;
+}
+
+kernel void compute_main() {
+ faceForward_e6908b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm
new file mode 100644
index 0000000..861015d
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %faceForward_e6908b "faceForward_e6908b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%faceForward_e6908b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 FaceForward %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %faceForward_e6908b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %faceForward_e6908b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %faceForward_e6908b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl
new file mode 100644
index 0000000..f232df2
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn faceForward_e6908b() {
+ var res : vec2<f32> = faceForward(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_e6908b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_e6908b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_e6908b();
+}
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl
new file mode 100644
index 0000000..0616792
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn faceForward_fc994b() {
+ var res: f32 = faceForward(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_fc994b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_fc994b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_fc994b();
+}
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl
new file mode 100644
index 0000000..88f1341
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void faceForward_fc994b() {
+ float res = faceforward(1.0f, 1.0f, 1.0f);
+}
+
+void vertex_main() {
+ faceForward_fc994b();
+ return;
+}
+
+void fragment_main() {
+ faceForward_fc994b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ faceForward_fc994b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl
new file mode 100644
index 0000000..660f385
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl
@@ -0,0 +1,50 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void faceForward_fc994b() {
+ float res = faceforward(1.0f, 1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ faceForward_fc994b();
+ return;
+}
+
+fragment void fragment_main() {
+ faceForward_fc994b();
+ return;
+}
+
+kernel void compute_main() {
+ faceForward_fc994b();
+ return;
+}
+
+
+tint_2Q1ua3.metal:5:17: error: call to 'faceforward' is ambiguous
+ float res = faceforward(1.0f, 1.0f, 1.0f);
+ ^~~~~~~~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:311:18: note: candidate function
+METAL_FUNC half2 faceforward(half2 n, half2 i, half2 nref)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:342:18: note: candidate function
+METAL_FUNC half3 faceforward(half3 n, half3 i, half3 nref)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:373:18: note: candidate function
+METAL_FUNC half4 faceforward(half4 n, half4 i, half4 nref)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:416:19: note: candidate function
+METAL_FUNC float2 faceforward(float2 n, float2 i, float2 nref)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:459:19: note: candidate function
+METAL_FUNC float3 faceforward(float3 n, float3 i, float3 nref)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:502:19: note: candidate function
+METAL_FUNC float4 faceforward(float4 n, float4 i, float4 nref)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm
new file mode 100644
index 0000000..fc9853e
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %faceForward_fc994b "faceForward_fc994b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%faceForward_fc994b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 FaceForward %float_1 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %faceForward_fc994b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %faceForward_fc994b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %faceForward_fc994b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl
new file mode 100644
index 0000000..3dc67f3
--- /dev/null
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn faceForward_fc994b() {
+ var res : f32 = faceForward(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ faceForward_fc994b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ faceForward_fc994b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ faceForward_fc994b();
+}
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl
new file mode 100644
index 0000000..c5a4e52
--- /dev/null
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn floor_3bccc4() {
+ var res: vec4<f32> = floor(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_3bccc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_3bccc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_3bccc4();
+}
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl
new file mode 100644
index 0000000..529d56a
--- /dev/null
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void floor_3bccc4() {
+ float4 res = floor(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ floor_3bccc4();
+ return;
+}
+
+void fragment_main() {
+ floor_3bccc4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ floor_3bccc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl
new file mode 100644
index 0000000..5b5e7e4
--- /dev/null
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void floor_3bccc4() {
+ float4 res = floor(float4());
+}
+
+vertex void vertex_main() {
+ floor_3bccc4();
+ return;
+}
+
+fragment void fragment_main() {
+ floor_3bccc4();
+ return;
+}
+
+kernel void compute_main() {
+ floor_3bccc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm
new file mode 100644
index 0000000..baf11b1
--- /dev/null
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %floor_3bccc4 "floor_3bccc4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%floor_3bccc4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Floor %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %floor_3bccc4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %floor_3bccc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %floor_3bccc4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl
new file mode 100644
index 0000000..574e6b1
--- /dev/null
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn floor_3bccc4() {
+ var res : vec4<f32> = floor(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_3bccc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_3bccc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_3bccc4();
+}
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl
new file mode 100644
index 0000000..06d4b49
--- /dev/null
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn floor_5fc9ac() {
+ var res: vec2<f32> = floor(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_5fc9ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_5fc9ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_5fc9ac();
+}
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl
new file mode 100644
index 0000000..241394d
--- /dev/null
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void floor_5fc9ac() {
+ float2 res = floor(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ floor_5fc9ac();
+ return;
+}
+
+void fragment_main() {
+ floor_5fc9ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ floor_5fc9ac();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl
new file mode 100644
index 0000000..c337a9c
--- /dev/null
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void floor_5fc9ac() {
+ float2 res = floor(float2());
+}
+
+vertex void vertex_main() {
+ floor_5fc9ac();
+ return;
+}
+
+fragment void fragment_main() {
+ floor_5fc9ac();
+ return;
+}
+
+kernel void compute_main() {
+ floor_5fc9ac();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm
new file mode 100644
index 0000000..81c4d3b
--- /dev/null
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %floor_5fc9ac "floor_5fc9ac"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%floor_5fc9ac = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Floor %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %floor_5fc9ac
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %floor_5fc9ac
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %floor_5fc9ac
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl
new file mode 100644
index 0000000..40d3dcb
--- /dev/null
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn floor_5fc9ac() {
+ var res : vec2<f32> = floor(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_5fc9ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_5fc9ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_5fc9ac();
+}
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl
new file mode 100644
index 0000000..e04571b
--- /dev/null
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn floor_60d7ea() {
+ var res: vec3<f32> = floor(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_60d7ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_60d7ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_60d7ea();
+}
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl
new file mode 100644
index 0000000..85d68ae
--- /dev/null
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void floor_60d7ea() {
+ float3 res = floor(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ floor_60d7ea();
+ return;
+}
+
+void fragment_main() {
+ floor_60d7ea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ floor_60d7ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl
new file mode 100644
index 0000000..3cb741a
--- /dev/null
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void floor_60d7ea() {
+ float3 res = floor(float3());
+}
+
+vertex void vertex_main() {
+ floor_60d7ea();
+ return;
+}
+
+fragment void fragment_main() {
+ floor_60d7ea();
+ return;
+}
+
+kernel void compute_main() {
+ floor_60d7ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm
new file mode 100644
index 0000000..28b16f2
--- /dev/null
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %floor_60d7ea "floor_60d7ea"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%floor_60d7ea = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Floor %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %floor_60d7ea
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %floor_60d7ea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %floor_60d7ea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl
new file mode 100644
index 0000000..f21f972
--- /dev/null
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn floor_60d7ea() {
+ var res : vec3<f32> = floor(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_60d7ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_60d7ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_60d7ea();
+}
diff --git a/test/intrinsics/gen/floor/66f154.wgsl b/test/intrinsics/gen/floor/66f154.wgsl
new file mode 100644
index 0000000..d0f5f33
--- /dev/null
+++ b/test/intrinsics/gen/floor/66f154.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn floor_66f154() {
+ var res: f32 = floor(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_66f154();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_66f154();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_66f154();
+}
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl
new file mode 100644
index 0000000..7fb4b6d
--- /dev/null
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void floor_66f154() {
+ float res = floor(1.0f);
+}
+
+void vertex_main() {
+ floor_66f154();
+ return;
+}
+
+void fragment_main() {
+ floor_66f154();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ floor_66f154();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl
new file mode 100644
index 0000000..4f57a10
--- /dev/null
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void floor_66f154() {
+ float res = floor(1.0f);
+}
+
+vertex void vertex_main() {
+ floor_66f154();
+ return;
+}
+
+fragment void fragment_main() {
+ floor_66f154();
+ return;
+}
+
+kernel void compute_main() {
+ floor_66f154();
+ return;
+}
+
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea32487
--- /dev/null
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %floor_66f154 "floor_66f154"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%floor_66f154 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Floor %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %floor_66f154
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %floor_66f154
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %floor_66f154
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl
new file mode 100644
index 0000000..0dc4d13
--- /dev/null
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn floor_66f154() {
+ var res : f32 = floor(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ floor_66f154();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ floor_66f154();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ floor_66f154();
+}
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl
new file mode 100644
index 0000000..2660eeb
--- /dev/null
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fma_26a7a9() {
+ var res: vec2<f32> = fma(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_26a7a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_26a7a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_26a7a9();
+}
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl
new file mode 100644
index 0000000..ddb3b74
--- /dev/null
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void fma_26a7a9() {
+ float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fma_26a7a9();
+ return;
+}
+
+void fragment_main() {
+ fma_26a7a9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fma_26a7a9();
+ return;
+}
+
+
+tint_EKmo0D:2:16: error: no matching function for call to 'fma'
+ float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument
+
+
+tint_EKmo0D:2:16: error: no matching function for call to 'fma'
+ float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument
+
+
+tint_EKmo0D:2:16: error: no matching function for call to 'fma'
+ float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument
+
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl
new file mode 100644
index 0000000..a1a1a5e
--- /dev/null
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fma_26a7a9() {
+ float2 res = fma(float2(), float2(), float2());
+}
+
+vertex void vertex_main() {
+ fma_26a7a9();
+ return;
+}
+
+fragment void fragment_main() {
+ fma_26a7a9();
+ return;
+}
+
+kernel void compute_main() {
+ fma_26a7a9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm
new file mode 100644
index 0000000..89f91ac
--- /dev/null
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fma_26a7a9 "fma_26a7a9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %fma_26a7a9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Fma %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fma_26a7a9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fma_26a7a9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fma_26a7a9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl
new file mode 100644
index 0000000..aab4068
--- /dev/null
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fma_26a7a9() {
+ var res : vec2<f32> = fma(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_26a7a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_26a7a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_26a7a9();
+}
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl
new file mode 100644
index 0000000..8ec1137
--- /dev/null
+++ b/test/intrinsics/gen/fma/6a3283.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fma_6a3283() {
+ var res: vec4<f32> = fma(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_6a3283();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_6a3283();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_6a3283();
+}
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl
new file mode 100644
index 0000000..2fb09c9
--- /dev/null
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void fma_6a3283() {
+ float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fma_6a3283();
+ return;
+}
+
+void fragment_main() {
+ fma_6a3283();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fma_6a3283();
+ return;
+}
+
+
+tint_dZoyK7:2:16: error: no matching function for call to 'fma'
+ float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument
+
+
+tint_dZoyK7:2:16: error: no matching function for call to 'fma'
+ float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument
+
+
+tint_dZoyK7:2:16: error: no matching function for call to 'fma'
+ float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument
+
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl
new file mode 100644
index 0000000..c45bd40
--- /dev/null
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fma_6a3283() {
+ float4 res = fma(float4(), float4(), float4());
+}
+
+vertex void vertex_main() {
+ fma_6a3283();
+ return;
+}
+
+fragment void fragment_main() {
+ fma_6a3283();
+ return;
+}
+
+kernel void compute_main() {
+ fma_6a3283();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm
new file mode 100644
index 0000000..160fecc
--- /dev/null
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fma_6a3283 "fma_6a3283"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %fma_6a3283 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Fma %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fma_6a3283
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fma_6a3283
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fma_6a3283
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl
new file mode 100644
index 0000000..f8e9f34
--- /dev/null
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fma_6a3283() {
+ var res : vec4<f32> = fma(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_6a3283();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_6a3283();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_6a3283();
+}
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl
new file mode 100644
index 0000000..9bc8727
--- /dev/null
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fma_c10ba3() {
+ var res: f32 = fma(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_c10ba3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_c10ba3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_c10ba3();
+}
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl
new file mode 100644
index 0000000..5aa77e7
--- /dev/null
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void fma_c10ba3() {
+ float res = fma(1.0f, 1.0f, 1.0f);
+}
+
+void vertex_main() {
+ fma_c10ba3();
+ return;
+}
+
+void fragment_main() {
+ fma_c10ba3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fma_c10ba3();
+ return;
+}
+
+
+tint_6WuQ1K:2:15: error: no matching function for call to 'fma'
+ float res = fma(1.0f, 1.0f, 1.0f);
+ ^~~
+note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument
+
+
+tint_6WuQ1K:2:15: error: no matching function for call to 'fma'
+ float res = fma(1.0f, 1.0f, 1.0f);
+ ^~~
+note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument
+
+
+tint_6WuQ1K:2:15: error: no matching function for call to 'fma'
+ float res = fma(1.0f, 1.0f, 1.0f);
+ ^~~
+note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument
+
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl
new file mode 100644
index 0000000..0ad9e9c
--- /dev/null
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fma_c10ba3() {
+ float res = fma(1.0f, 1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ fma_c10ba3();
+ return;
+}
+
+fragment void fragment_main() {
+ fma_c10ba3();
+ return;
+}
+
+kernel void compute_main() {
+ fma_c10ba3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd28d8e
--- /dev/null
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fma_c10ba3 "fma_c10ba3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %fma_c10ba3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Fma %float_1 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %fma_c10ba3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %fma_c10ba3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %fma_c10ba3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl
new file mode 100644
index 0000000..58f5b94
--- /dev/null
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fma_c10ba3() {
+ var res : f32 = fma(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_c10ba3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_c10ba3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_c10ba3();
+}
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl
new file mode 100644
index 0000000..2f788d3
--- /dev/null
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fma_e17c5c() {
+ var res: vec3<f32> = fma(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_e17c5c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_e17c5c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_e17c5c();
+}
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl
new file mode 100644
index 0000000..01b8be3
--- /dev/null
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void fma_e17c5c() {
+ float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fma_e17c5c();
+ return;
+}
+
+void fragment_main() {
+ fma_e17c5c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fma_e17c5c();
+ return;
+}
+
+
+tint_5UHLns:2:16: error: no matching function for call to 'fma'
+ float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument
+
+
+tint_5UHLns:2:16: error: no matching function for call to 'fma'
+ float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument
+
+
+tint_5UHLns:2:16: error: no matching function for call to 'fma'
+ float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^~~
+note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument
+
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl
new file mode 100644
index 0000000..fb58389
--- /dev/null
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fma_e17c5c() {
+ float3 res = fma(float3(), float3(), float3());
+}
+
+vertex void vertex_main() {
+ fma_e17c5c();
+ return;
+}
+
+fragment void fragment_main() {
+ fma_e17c5c();
+ return;
+}
+
+kernel void compute_main() {
+ fma_e17c5c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm
new file mode 100644
index 0000000..f533975
--- /dev/null
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fma_e17c5c "fma_e17c5c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %fma_e17c5c = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Fma %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fma_e17c5c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fma_e17c5c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fma_e17c5c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl
new file mode 100644
index 0000000..23ed6e2
--- /dev/null
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fma_e17c5c() {
+ var res : vec3<f32> = fma(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fma_e17c5c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fma_e17c5c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fma_e17c5c();
+}
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl
new file mode 100644
index 0000000..7c2e38b
--- /dev/null
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fract_8bc1e9() {
+ var res: vec4<f32> = fract(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_8bc1e9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_8bc1e9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_8bc1e9();
+}
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl
new file mode 100644
index 0000000..5cf8141
--- /dev/null
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fract_8bc1e9() {
+ float4 res = frac(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fract_8bc1e9();
+ return;
+}
+
+void fragment_main() {
+ fract_8bc1e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fract_8bc1e9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl
new file mode 100644
index 0000000..cd30c06
--- /dev/null
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fract_8bc1e9() {
+ float4 res = fract(float4());
+}
+
+vertex void vertex_main() {
+ fract_8bc1e9();
+ return;
+}
+
+fragment void fragment_main() {
+ fract_8bc1e9();
+ return;
+}
+
+kernel void compute_main() {
+ fract_8bc1e9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm
new file mode 100644
index 0000000..bb69bbd
--- /dev/null
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fract_8bc1e9 "fract_8bc1e9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%fract_8bc1e9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Fract %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fract_8bc1e9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fract_8bc1e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fract_8bc1e9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl
new file mode 100644
index 0000000..5107174
--- /dev/null
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fract_8bc1e9() {
+ var res : vec4<f32> = fract(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_8bc1e9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_8bc1e9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_8bc1e9();
+}
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl
new file mode 100644
index 0000000..754cd7d
--- /dev/null
+++ b/test/intrinsics/gen/fract/943cb1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fract_943cb1() {
+ var res: vec2<f32> = fract(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_943cb1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_943cb1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_943cb1();
+}
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl
new file mode 100644
index 0000000..4a9152d
--- /dev/null
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fract_943cb1() {
+ float2 res = frac(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fract_943cb1();
+ return;
+}
+
+void fragment_main() {
+ fract_943cb1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fract_943cb1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl
new file mode 100644
index 0000000..8df4530
--- /dev/null
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fract_943cb1() {
+ float2 res = fract(float2());
+}
+
+vertex void vertex_main() {
+ fract_943cb1();
+ return;
+}
+
+fragment void fragment_main() {
+ fract_943cb1();
+ return;
+}
+
+kernel void compute_main() {
+ fract_943cb1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm
new file mode 100644
index 0000000..e1b7965
--- /dev/null
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fract_943cb1 "fract_943cb1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%fract_943cb1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Fract %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fract_943cb1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fract_943cb1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fract_943cb1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl
new file mode 100644
index 0000000..88db883
--- /dev/null
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fract_943cb1() {
+ var res : vec2<f32> = fract(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_943cb1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_943cb1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_943cb1();
+}
diff --git a/test/intrinsics/gen/fract/a49758.wgsl b/test/intrinsics/gen/fract/a49758.wgsl
new file mode 100644
index 0000000..d5f4528
--- /dev/null
+++ b/test/intrinsics/gen/fract/a49758.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fract_a49758() {
+ var res: vec3<f32> = fract(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_a49758();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_a49758();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_a49758();
+}
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl
new file mode 100644
index 0000000..4f27c5f
--- /dev/null
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fract_a49758() {
+ float3 res = frac(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fract_a49758();
+ return;
+}
+
+void fragment_main() {
+ fract_a49758();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fract_a49758();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl
new file mode 100644
index 0000000..6c302f2
--- /dev/null
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fract_a49758() {
+ float3 res = fract(float3());
+}
+
+vertex void vertex_main() {
+ fract_a49758();
+ return;
+}
+
+fragment void fragment_main() {
+ fract_a49758();
+ return;
+}
+
+kernel void compute_main() {
+ fract_a49758();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm
new file mode 100644
index 0000000..ef18a35
--- /dev/null
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fract_a49758 "fract_a49758"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%fract_a49758 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Fract %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %fract_a49758
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fract_a49758
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %fract_a49758
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl
new file mode 100644
index 0000000..f20dc80
--- /dev/null
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fract_a49758() {
+ var res : vec3<f32> = fract(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_a49758();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_a49758();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_a49758();
+}
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl
new file mode 100644
index 0000000..26b513a
--- /dev/null
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fract_fa5c71() {
+ var res: f32 = fract(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_fa5c71();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_fa5c71();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_fa5c71();
+}
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl
new file mode 100644
index 0000000..927ec31
--- /dev/null
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fract_fa5c71() {
+ float res = frac(1.0f);
+}
+
+void vertex_main() {
+ fract_fa5c71();
+ return;
+}
+
+void fragment_main() {
+ fract_fa5c71();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fract_fa5c71();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl
new file mode 100644
index 0000000..5f113c2
--- /dev/null
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void fract_fa5c71() {
+ float res = fract(1.0f);
+}
+
+vertex void vertex_main() {
+ fract_fa5c71();
+ return;
+}
+
+fragment void fragment_main() {
+ fract_fa5c71();
+ return;
+}
+
+kernel void compute_main() {
+ fract_fa5c71();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm
new file mode 100644
index 0000000..5003c11
--- /dev/null
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fract_fa5c71 "fract_fa5c71"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%fract_fa5c71 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Fract %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %fract_fa5c71
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %fract_fa5c71
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %fract_fa5c71
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2bed7c
--- /dev/null
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fract_fa5c71() {
+ var res : f32 = fract(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fract_fa5c71();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fract_fa5c71();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fract_fa5c71();
+}
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl
new file mode 100644
index 0000000..485a26d
--- /dev/null
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_1d6b62() {
+ var arg_1: vec2<i32>;
+ var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_1d6b62();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_1d6b62();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_1d6b62();
+}
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl
new file mode 100644
index 0000000..4bfcbe0
--- /dev/null
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_1d6b62() {
+ var arg_1 : vec2<i32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_1d6b62();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_1d6b62();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_1d6b62();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl
new file mode 100644
index 0000000..569c4e6
--- /dev/null
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_1d6b62() {
+ var arg_1 : vec2<i32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_1d6b62();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_1d6b62();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_1d6b62();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm
new file mode 100644
index 0000000..f697f59
--- /dev/null
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_1d6b62 "frexp_1d6b62"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %13 = OpConstantNull %v2int
+ %v2float = OpTypeVector %float 2
+ %17 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%frexp_1d6b62 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %13
+ %res = OpVariable %_ptr_Function_v2float Function %17
+ %14 = OpExtInst %v2float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_1d6b62
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_1d6b62
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_1d6b62
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl
new file mode 100644
index 0000000..9222be8
--- /dev/null
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_1d6b62() {
+ var arg_1 : vec2<i32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_1d6b62();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_1d6b62();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_1d6b62();
+}
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl
new file mode 100644
index 0000000..6e77b4a
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_2507b2() {
+ var arg_1: vec4<u32>;
+ var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2507b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2507b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2507b2();
+}
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl
new file mode 100644
index 0000000..620eb05
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_2507b2() {
+ var arg_1 : vec4<u32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2507b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2507b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2507b2();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl
new file mode 100644
index 0000000..1a9febb
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_2507b2() {
+ var arg_1 : vec4<u32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2507b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2507b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2507b2();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm
new file mode 100644
index 0000000..9f3228f
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_2507b2 "frexp_2507b2"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %13 = OpConstantNull %v4uint
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%frexp_2507b2 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4uint Function %13
+ %res = OpVariable %_ptr_Function_v4float Function %17
+ %14 = OpExtInst %v4float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_2507b2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_2507b2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_2507b2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl
new file mode 100644
index 0000000..436b452
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_2507b2() {
+ var arg_1 : vec4<u32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2507b2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2507b2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2507b2();
+}
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl
new file mode 100644
index 0000000..d23094b
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_2a171c() {
+ var arg_1: vec2<u32>;
+ var res: vec2<f32> = frexp(vec2<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2a171c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2a171c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2a171c();
+}
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl
new file mode 100644
index 0000000..0e70670
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_2a171c() {
+ var arg_1 : vec2<u32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2a171c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2a171c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2a171c();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl
new file mode 100644
index 0000000..ea365cf
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_2a171c() {
+ var arg_1 : vec2<u32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2a171c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2a171c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2a171c();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm
new file mode 100644
index 0000000..3fa83d3
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_2a171c "frexp_2a171c"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %13 = OpConstantNull %v2uint
+ %v2float = OpTypeVector %float 2
+ %17 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%frexp_2a171c = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %13
+ %res = OpVariable %_ptr_Function_v2float Function %17
+ %14 = OpExtInst %v2float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_2a171c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_2a171c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_2a171c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl
new file mode 100644
index 0000000..e5bdf95
--- /dev/null
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_2a171c() {
+ var arg_1 : vec2<u32>;
+ var res : vec2<f32> = frexp(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_2a171c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_2a171c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_2a171c();
+}
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl
new file mode 100644
index 0000000..848bd3f
--- /dev/null
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_34dd30() {
+ var arg_1: u32;
+ var res: f32 = frexp(1.0, &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_34dd30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_34dd30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_34dd30();
+}
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl
new file mode 100644
index 0000000..ee41ea0
--- /dev/null
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_34dd30() {
+ var arg_1 : u32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_34dd30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_34dd30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_34dd30();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl
new file mode 100644
index 0000000..05171f1
--- /dev/null
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_34dd30() {
+ var arg_1 : u32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_34dd30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_34dd30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_34dd30();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm
new file mode 100644
index 0000000..2e9b4d9
--- /dev/null
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_34dd30 "frexp_34dd30"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %12 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%frexp_34dd30 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %12
+ %res = OpVariable %_ptr_Function_float Function %4
+ %13 = OpExtInst %float %14 Frexp %float_1 %arg_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %frexp_34dd30
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %frexp_34dd30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_34dd30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl
new file mode 100644
index 0000000..c43e4c1
--- /dev/null
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_34dd30() {
+ var arg_1 : u32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_34dd30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_34dd30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_34dd30();
+}
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl
new file mode 100644
index 0000000..d4c5842
--- /dev/null
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_4b73e3() {
+ var arg_1: vec4<i32>;
+ var res: vec4<f32> = frexp(vec4<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_4b73e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_4b73e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_4b73e3();
+}
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl
new file mode 100644
index 0000000..238343c
--- /dev/null
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_4b73e3() {
+ var arg_1 : vec4<i32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_4b73e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_4b73e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_4b73e3();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl
new file mode 100644
index 0000000..d993f99
--- /dev/null
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_4b73e3() {
+ var arg_1 : vec4<i32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_4b73e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_4b73e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_4b73e3();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab2f023
--- /dev/null
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_4b73e3 "frexp_4b73e3"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %13 = OpConstantNull %v4int
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%frexp_4b73e3 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4int Function %13
+ %res = OpVariable %_ptr_Function_v4float Function %17
+ %14 = OpExtInst %v4float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_4b73e3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_4b73e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_4b73e3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl
new file mode 100644
index 0000000..3672ae0
--- /dev/null
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_4b73e3() {
+ var arg_1 : vec4<i32>;
+ var res : vec4<f32> = frexp(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_4b73e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_4b73e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_4b73e3();
+}
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl
new file mode 100644
index 0000000..2acbd4c
--- /dev/null
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_79ed81() {
+ var arg_1: vec3<i32>;
+ var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_79ed81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_79ed81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_79ed81();
+}
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl
new file mode 100644
index 0000000..21b606e
--- /dev/null
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_79ed81() {
+ var arg_1 : vec3<i32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_79ed81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_79ed81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_79ed81();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl
new file mode 100644
index 0000000..7b06582
--- /dev/null
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_79ed81() {
+ var arg_1 : vec3<i32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_79ed81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_79ed81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_79ed81();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a7f736
--- /dev/null
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_79ed81 "frexp_79ed81"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %13 = OpConstantNull %v3int
+ %v3float = OpTypeVector %float 3
+ %17 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%frexp_79ed81 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %13
+ %res = OpVariable %_ptr_Function_v3float Function %17
+ %14 = OpExtInst %v3float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_79ed81
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_79ed81
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_79ed81
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl
new file mode 100644
index 0000000..170e255
--- /dev/null
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_79ed81() {
+ var arg_1 : vec3<i32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_79ed81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_79ed81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_79ed81();
+}
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl
new file mode 100644
index 0000000..5d2cf6e
--- /dev/null
+++ b/test/intrinsics/gen/frexp/99b922.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_99b922() {
+ var arg_1: i32;
+ var res: f32 = frexp(1.0, &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_99b922();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_99b922();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_99b922();
+}
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl
new file mode 100644
index 0000000..14fef02
--- /dev/null
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_99b922() {
+ var arg_1 : i32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_99b922();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_99b922();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_99b922();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl
new file mode 100644
index 0000000..1a98e37
--- /dev/null
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_99b922() {
+ var arg_1 : i32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_99b922();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_99b922();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_99b922();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm
new file mode 100644
index 0000000..03670ba
--- /dev/null
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_99b922 "frexp_99b922"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %12 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%frexp_99b922 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %12
+ %res = OpVariable %_ptr_Function_float Function %4
+ %13 = OpExtInst %float %14 Frexp %float_1 %arg_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %frexp_99b922
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %frexp_99b922
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_99b922
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl
new file mode 100644
index 0000000..e07d4c3
--- /dev/null
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_99b922() {
+ var arg_1 : i32;
+ var res : f32 = frexp(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_99b922();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_99b922();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_99b922();
+}
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl
new file mode 100644
index 0000000..298d24e
--- /dev/null
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn frexp_cb41c5() {
+ var arg_1: vec3<u32>;
+ var res: vec3<f32> = frexp(vec3<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_cb41c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_cb41c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_cb41c5();
+}
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl
new file mode 100644
index 0000000..820b451
--- /dev/null
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_cb41c5() {
+ var arg_1 : vec3<u32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_cb41c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_cb41c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_cb41c5();
+}
+
+Failed to generate: error: Unknown builtin method: frexp
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl
new file mode 100644
index 0000000..ab6546f
--- /dev/null
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn frexp_cb41c5() {
+ var arg_1 : vec3<u32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_cb41c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_cb41c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_cb41c5();
+}
+
+Failed to generate: error: Unknown import method: frexp
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm
new file mode 100644
index 0000000..bec511a
--- /dev/null
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ %16 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %frexp_cb41c5 "frexp_cb41c5"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %13 = OpConstantNull %v3uint
+ %v3float = OpTypeVector %float 3
+ %17 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%frexp_cb41c5 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %13
+ %res = OpVariable %_ptr_Function_v3float Function %17
+ %14 = OpExtInst %v3float %16 Frexp %17 %arg_1
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %frexp_cb41c5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %frexp_cb41c5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %frexp_cb41c5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl
new file mode 100644
index 0000000..7fcb8e0
--- /dev/null
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn frexp_cb41c5() {
+ var arg_1 : vec3<u32>;
+ var res : vec3<f32> = frexp(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ frexp_cb41c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ frexp_cb41c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ frexp_cb41c5();
+}
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl
new file mode 100644
index 0000000..3a7a285
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidth_5d1b39() {
+ var res: vec3<f32> = fwidth(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_5d1b39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_5d1b39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_5d1b39();
+}
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl
new file mode 100644
index 0000000..1d700b1
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidth_5d1b39() {
+ float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidth_5d1b39();
+ return;
+}
+
+void fragment_main() {
+ fwidth_5d1b39();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidth_5d1b39();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl
new file mode 100644
index 0000000..6d2c8fc
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidth_5d1b39() {
+ float3 res = fwidth(float3());
+}
+
+vertex void vertex_main() {
+ fwidth_5d1b39();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidth_5d1b39();
+ return;
+}
+
+kernel void compute_main() {
+ fwidth_5d1b39();
+ return;
+}
+
+
+tint_6o3PFV.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float3 res = fwidth(float3());
+ ^
+tint_6o3PFV.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a vertex function
+tint_6o3PFV.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm
new file mode 100644
index 0000000..4816e10
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidth_5d1b39 "fwidth_5d1b39"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %11 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%fwidth_5d1b39 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %11
+ %9 = OpFwidth %v3float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidth_5d1b39
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidth_5d1b39
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidth_5d1b39
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidth_5d1b39], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: Fwidth
+
+ %fwidth_5d1b39 = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl
new file mode 100644
index 0000000..bee6d3f
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidth_5d1b39() {
+ var res : vec3<f32> = fwidth(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_5d1b39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_5d1b39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_5d1b39();
+}
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl
new file mode 100644
index 0000000..9f657d1
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidth_b83ebb() {
+ var res: vec2<f32> = fwidth(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_b83ebb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_b83ebb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_b83ebb();
+}
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl
new file mode 100644
index 0000000..db5d8aa
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidth_b83ebb() {
+ float2 res = fwidth(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidth_b83ebb();
+ return;
+}
+
+void fragment_main() {
+ fwidth_b83ebb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidth_b83ebb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl
new file mode 100644
index 0000000..b01f8dd
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidth_b83ebb() {
+ float2 res = fwidth(float2());
+}
+
+vertex void vertex_main() {
+ fwidth_b83ebb();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidth_b83ebb();
+ return;
+}
+
+kernel void compute_main() {
+ fwidth_b83ebb();
+ return;
+}
+
+
+tint_STFkVK.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float2 res = fwidth(float2());
+ ^
+tint_STFkVK.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a vertex function
+tint_STFkVK.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm
new file mode 100644
index 0000000..b22356f
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidth_b83ebb "fwidth_b83ebb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %11 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%fwidth_b83ebb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %11
+ %9 = OpFwidth %v2float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidth_b83ebb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidth_b83ebb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidth_b83ebb
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidth_b83ebb], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: Fwidth
+
+ %fwidth_b83ebb = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl
new file mode 100644
index 0000000..4618777
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidth_b83ebb() {
+ var res : vec2<f32> = fwidth(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_b83ebb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_b83ebb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_b83ebb();
+}
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl
new file mode 100644
index 0000000..1110b54
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidth_d2ab9a() {
+ var res: vec4<f32> = fwidth(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_d2ab9a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_d2ab9a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_d2ab9a();
+}
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl
new file mode 100644
index 0000000..e963fc6
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidth_d2ab9a() {
+ float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
+void fragment_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl
new file mode 100644
index 0000000..af3f56b
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidth_d2ab9a() {
+ float4 res = fwidth(float4());
+}
+
+vertex void vertex_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
+kernel void compute_main() {
+ fwidth_d2ab9a();
+ return;
+}
+
+
+tint_BZ4hJz.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float4 res = fwidth(float4());
+ ^
+tint_BZ4hJz.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a vertex function
+tint_BZ4hJz.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm
new file mode 100644
index 0000000..0ce3af0
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidth_d2ab9a "fwidth_d2ab9a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %11 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%fwidth_d2ab9a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %9 = OpFwidth %v4float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidth_d2ab9a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidth_d2ab9a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidth_d2ab9a
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidth_d2ab9a], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: Fwidth
+
+ %fwidth_d2ab9a = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl
new file mode 100644
index 0000000..95ec91a
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidth_d2ab9a() {
+ var res : vec4<f32> = fwidth(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_d2ab9a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_d2ab9a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_d2ab9a();
+}
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl
new file mode 100644
index 0000000..d830712
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidth_df38ef() {
+ var res: f32 = fwidth(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_df38ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_df38ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_df38ef();
+}
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl
new file mode 100644
index 0000000..4610453
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidth_df38ef() {
+ float res = fwidth(1.0f);
+}
+
+void vertex_main() {
+ fwidth_df38ef();
+ return;
+}
+
+void fragment_main() {
+ fwidth_df38ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidth_df38ef();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl
new file mode 100644
index 0000000..c63e604
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidth_df38ef() {
+ float res = fwidth(1.0f);
+}
+
+vertex void vertex_main() {
+ fwidth_df38ef();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidth_df38ef();
+ return;
+}
+
+kernel void compute_main() {
+ fwidth_df38ef();
+ return;
+}
+
+
+tint_YeBAYS.metal:5:9: warning: unused variable 'res' [-Wunused-variable]
+ float res = fwidth(1.0f);
+ ^
+tint_YeBAYS.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a vertex function
+tint_YeBAYS.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm
new file mode 100644
index 0000000..7dcebbc
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 22
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidth_df38ef "fwidth_df38ef"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%fwidth_df38ef = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpFwidth %float %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %14 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %15 = OpFunctionCall %void %fwidth_df38ef
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %17 = OpLabel
+ %18 = OpFunctionCall %void %fwidth_df38ef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fwidth_df38ef
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '13[%vertex_main]'s callgraph contains function <id> 7[%fwidth_df38ef], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: Fwidth
+
+ %fwidth_df38ef = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl
new file mode 100644
index 0000000..cf808fe
--- /dev/null
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidth_df38ef() {
+ var res : f32 = fwidth(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidth_df38ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidth_df38ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidth_df38ef();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl
new file mode 100644
index 0000000..eb1a5da
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthCoarse_159c8a() {
+ var res: f32 = fwidthCoarse(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_159c8a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_159c8a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_159c8a();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl
new file mode 100644
index 0000000..356be65
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthCoarse_159c8a() {
+ float res = fwidth(1.0f);
+}
+
+void vertex_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
+void fragment_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl
new file mode 100644
index 0000000..18857ef
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthCoarse_159c8a() {
+ float res = fwidth(1.0f);
+}
+
+vertex void vertex_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthCoarse_159c8a();
+ return;
+}
+
+
+tint_IJRHv8.metal:5:9: warning: unused variable 'res' [-Wunused-variable]
+ float res = fwidth(1.0f);
+ ^
+tint_IJRHv8.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a vertex function
+tint_IJRHv8.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm
new file mode 100644
index 0000000..12a2eff
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 22
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthCoarse_159c8a "fwidthCoarse_159c8a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%fwidthCoarse_159c8a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpFwidthCoarse %float %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %14 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %15 = OpFunctionCall %void %fwidthCoarse_159c8a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %17 = OpLabel
+ %18 = OpFunctionCall %void %fwidthCoarse_159c8a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fwidthCoarse_159c8a
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '13[%vertex_main]'s callgraph contains function <id> 7[%fwidthCoarse_159c8a], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse
+
+ %fwidthCoarse_159c8a = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl
new file mode 100644
index 0000000..38b8696
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthCoarse_159c8a() {
+ var res : f32 = fwidthCoarse(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_159c8a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_159c8a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_159c8a();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl
new file mode 100644
index 0000000..05b4fcf
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthCoarse_1e59d9() {
+ var res: vec3<f32> = fwidthCoarse(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_1e59d9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_1e59d9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_1e59d9();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl
new file mode 100644
index 0000000..e3e1f18
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthCoarse_1e59d9() {
+ float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
+void fragment_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl
new file mode 100644
index 0000000..1d34e45
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthCoarse_1e59d9() {
+ float3 res = fwidth(float3());
+}
+
+vertex void vertex_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthCoarse_1e59d9();
+ return;
+}
+
+
+tint_nMosr7.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float3 res = fwidth(float3());
+ ^
+tint_nMosr7.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a vertex function
+tint_nMosr7.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm
new file mode 100644
index 0000000..e15f050
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthCoarse_1e59d9 "fwidthCoarse_1e59d9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %11 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%fwidthCoarse_1e59d9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %11
+ %9 = OpFwidthCoarse %v3float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthCoarse_1e59d9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthCoarse_1e59d9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthCoarse_1e59d9
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthCoarse_1e59d9], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse
+
+ %fwidthCoarse_1e59d9 = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl
new file mode 100644
index 0000000..adb83b7
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthCoarse_1e59d9() {
+ var res : vec3<f32> = fwidthCoarse(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_1e59d9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_1e59d9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_1e59d9();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl
new file mode 100644
index 0000000..933322f
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthCoarse_4e4fc4() {
+ var res: vec4<f32> = fwidthCoarse(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_4e4fc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_4e4fc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_4e4fc4();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl
new file mode 100644
index 0000000..ba1c141
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthCoarse_4e4fc4() {
+ float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
+void fragment_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl
new file mode 100644
index 0000000..476cee9
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthCoarse_4e4fc4() {
+ float4 res = fwidth(float4());
+}
+
+vertex void vertex_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthCoarse_4e4fc4();
+ return;
+}
+
+
+tint_Rs09zG.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float4 res = fwidth(float4());
+ ^
+tint_Rs09zG.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a vertex function
+tint_Rs09zG.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
new file mode 100644
index 0000000..4edff8c
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthCoarse_4e4fc4 "fwidthCoarse_4e4fc4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %11 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%fwidthCoarse_4e4fc4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %9 = OpFwidthCoarse %v4float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthCoarse_4e4fc4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthCoarse_4e4fc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthCoarse_4e4fc4
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthCoarse_4e4fc4], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse
+
+ %fwidthCoarse_4e4fc4 = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
new file mode 100644
index 0000000..245a06c
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthCoarse_4e4fc4() {
+ var res : vec4<f32> = fwidthCoarse(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_4e4fc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_4e4fc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_4e4fc4();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl
new file mode 100644
index 0000000..928a912
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthCoarse_e653f7() {
+ var res: vec2<f32> = fwidthCoarse(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_e653f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_e653f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_e653f7();
+}
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl
new file mode 100644
index 0000000..dc9e721
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthCoarse_e653f7() {
+ float2 res = fwidth(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
+void fragment_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl
new file mode 100644
index 0000000..1cccfb7
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthCoarse_e653f7() {
+ float2 res = fwidth(float2());
+}
+
+vertex void vertex_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthCoarse_e653f7();
+ return;
+}
+
+
+tint_YU6pTb.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float2 res = fwidth(float2());
+ ^
+tint_YU6pTb.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a vertex function
+tint_YU6pTb.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..137bfd8
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthCoarse_e653f7 "fwidthCoarse_e653f7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %11 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%fwidthCoarse_e653f7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %11
+ %9 = OpFwidthCoarse %v2float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthCoarse_e653f7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthCoarse_e653f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthCoarse_e653f7
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthCoarse_e653f7], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse
+
+ %fwidthCoarse_e653f7 = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0568f9
--- /dev/null
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthCoarse_e653f7() {
+ var res : vec2<f32> = fwidthCoarse(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthCoarse_e653f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthCoarse_e653f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthCoarse_e653f7();
+}
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl
new file mode 100644
index 0000000..2db8dfb
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthFine_523fdc() {
+ var res: vec3<f32> = fwidthFine(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_523fdc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_523fdc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_523fdc();
+}
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl
new file mode 100644
index 0000000..a270d2d
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthFine_523fdc() {
+ float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
+void fragment_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl
new file mode 100644
index 0000000..8b5d8da
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthFine_523fdc() {
+ float3 res = fwidth(float3());
+}
+
+vertex void vertex_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthFine_523fdc();
+ return;
+}
+
+
+tint_T9vWZ8.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float3 res = fwidth(float3());
+ ^
+tint_T9vWZ8.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a vertex function
+tint_T9vWZ8.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v3f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm
new file mode 100644
index 0000000..622b318
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthFine_523fdc "fwidthFine_523fdc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %11 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%fwidthFine_523fdc = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %11
+ %9 = OpFwidthFine %v3float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthFine_523fdc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthFine_523fdc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthFine_523fdc
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthFine_523fdc], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthFine
+
+ %fwidthFine_523fdc = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl
new file mode 100644
index 0000000..e7c73a9
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthFine_523fdc() {
+ var res : vec3<f32> = fwidthFine(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_523fdc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_523fdc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_523fdc();
+}
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl
new file mode 100644
index 0000000..de6e3fe
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthFine_68f4ef() {
+ var res: vec4<f32> = fwidthFine(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_68f4ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_68f4ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_68f4ef();
+}
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl
new file mode 100644
index 0000000..23406ee
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthFine_68f4ef() {
+ float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
+void fragment_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl
new file mode 100644
index 0000000..d1afd55
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthFine_68f4ef() {
+ float4 res = fwidth(float4());
+}
+
+vertex void vertex_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthFine_68f4ef();
+ return;
+}
+
+
+tint_ojzEQ7.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float4 res = fwidth(float4());
+ ^
+tint_ojzEQ7.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a vertex function
+tint_ojzEQ7.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v4f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a2cfe7
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthFine_68f4ef "fwidthFine_68f4ef"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %11 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%fwidthFine_68f4ef = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %9 = OpFwidthFine %v4float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthFine_68f4ef
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthFine_68f4ef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthFine_68f4ef
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthFine_68f4ef], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthFine
+
+ %fwidthFine_68f4ef = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl
new file mode 100644
index 0000000..9cc2625
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthFine_68f4ef() {
+ var res : vec4<f32> = fwidthFine(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_68f4ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_68f4ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_68f4ef();
+}
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl
new file mode 100644
index 0000000..be30a23
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthFine_f1742d() {
+ var res: f32 = fwidthFine(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_f1742d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_f1742d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_f1742d();
+}
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl
new file mode 100644
index 0000000..774093a
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthFine_f1742d() {
+ float res = fwidth(1.0f);
+}
+
+void vertex_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
+void fragment_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl
new file mode 100644
index 0000000..2e39779
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthFine_f1742d() {
+ float res = fwidth(1.0f);
+}
+
+vertex void vertex_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthFine_f1742d();
+ return;
+}
+
+
+tint_WPjnD2.metal:5:9: warning: unused variable 'res' [-Wunused-variable]
+ float res = fwidth(1.0f);
+ ^
+tint_WPjnD2.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a vertex function
+tint_WPjnD2.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm
new file mode 100644
index 0000000..8e452ad
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 22
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthFine_f1742d "fwidthFine_f1742d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%fwidthFine_f1742d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpFwidthFine %float %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %14 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %15 = OpFunctionCall %void %fwidthFine_f1742d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %17 = OpLabel
+ %18 = OpFunctionCall %void %fwidthFine_f1742d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %fwidthFine_f1742d
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '13[%vertex_main]'s callgraph contains function <id> 7[%fwidthFine_f1742d], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthFine
+
+ %fwidthFine_f1742d = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl
new file mode 100644
index 0000000..93e9083
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthFine_f1742d() {
+ var res : f32 = fwidthFine(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_f1742d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_f1742d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_f1742d();
+}
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl
new file mode 100644
index 0000000..629a950
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn fwidthFine_ff6aa0() {
+ var res: vec2<f32> = fwidthFine(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_ff6aa0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_ff6aa0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_ff6aa0();
+}
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl
new file mode 100644
index 0000000..f38c96a
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void fwidthFine_ff6aa0() {
+ float2 res = fwidth(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
+void fragment_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl
new file mode 100644
index 0000000..bb857b7
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl
@@ -0,0 +1,40 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void fwidthFine_ff6aa0() {
+ float2 res = fwidth(float2());
+}
+
+vertex void vertex_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
+fragment void fragment_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
+kernel void compute_main() {
+ fwidthFine_ff6aa0();
+ return;
+}
+
+
+tint_YbLbM2.metal:5:10: warning: unused variable 'res' [-Wunused-variable]
+ float2 res = fwidth(float2());
+ ^
+tint_YbLbM2.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions
+vertex void vertex_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a vertex function
+tint_YbLbM2.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions
+kernel void compute_main() {
+ ^
+note: function air.fwidth.v2f32 is not allowed within a kernel function
+1 warning and 2 errors generated.
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb2f5d8
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpCapability DerivativeControl
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %fwidthFine_ff6aa0 "fwidthFine_ff6aa0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %11 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%fwidthFine_ff6aa0 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %11
+ %9 = OpFwidthFine %v2float %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %fwidthFine_ff6aa0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %fwidthFine_ff6aa0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %fwidthFine_ff6aa0
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpEntryPoint Entry Point <id> '14[%vertex_main]'s callgraph contains function <id> 7[%fwidthFine_ff6aa0], which cannot be used with the current execution model:
+Derivative instructions require Fragment or GLCompute execution model: FwidthFine
+
+ %fwidthFine_ff6aa0 = OpFunction %void None %5
+
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl
new file mode 100644
index 0000000..4d0bcb6
--- /dev/null
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn fwidthFine_ff6aa0() {
+ var res : vec2<f32> = fwidthFine(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ fwidthFine_ff6aa0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ fwidthFine_ff6aa0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ fwidthFine_ff6aa0();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl
new file mode 100644
index 0000000..070d48c
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn inverseSqrt_84407e() {
+ var res: f32 = inverseSqrt(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_84407e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_84407e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_84407e();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl
new file mode 100644
index 0000000..2a185e9
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void inverseSqrt_84407e() {
+ float res = rsqrt(1.0f);
+}
+
+void vertex_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
+void fragment_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl
new file mode 100644
index 0000000..9e3ec22
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_84407e() {
+ float res = rsqrt(1.0f);
+}
+
+vertex void vertex_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
+fragment void fragment_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
+kernel void compute_main() {
+ inverseSqrt_84407e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm
new file mode 100644
index 0000000..d00a8e2
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %inverseSqrt_84407e "inverseSqrt_84407e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%inverseSqrt_84407e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 InverseSqrt %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %inverseSqrt_84407e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %inverseSqrt_84407e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %inverseSqrt_84407e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1a2d35
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn inverseSqrt_84407e() {
+ var res : f32 = inverseSqrt(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_84407e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_84407e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_84407e();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl
new file mode 100644
index 0000000..bb7bd2b
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn inverseSqrt_8f2bd2() {
+ var res: vec2<f32> = inverseSqrt(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_8f2bd2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_8f2bd2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_8f2bd2();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl
new file mode 100644
index 0000000..efa0978
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void inverseSqrt_8f2bd2() {
+ float2 res = rsqrt(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
+void fragment_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl
new file mode 100644
index 0000000..15325bc
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_8f2bd2() {
+ float2 res = rsqrt(float2());
+}
+
+vertex void vertex_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
+fragment void fragment_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
+kernel void compute_main() {
+ inverseSqrt_8f2bd2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm
new file mode 100644
index 0000000..9f2fae1
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%inverseSqrt_8f2bd2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 InverseSqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %inverseSqrt_8f2bd2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %inverseSqrt_8f2bd2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %inverseSqrt_8f2bd2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl
new file mode 100644
index 0000000..496ae23
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn inverseSqrt_8f2bd2() {
+ var res : vec2<f32> = inverseSqrt(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_8f2bd2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_8f2bd2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_8f2bd2();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl
new file mode 100644
index 0000000..dda3627
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn inverseSqrt_b197b1() {
+ var res: vec3<f32> = inverseSqrt(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_b197b1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_b197b1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_b197b1();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl
new file mode 100644
index 0000000..3f411b9
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void inverseSqrt_b197b1() {
+ float3 res = rsqrt(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
+void fragment_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl
new file mode 100644
index 0000000..4fecada
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_b197b1() {
+ float3 res = rsqrt(float3());
+}
+
+vertex void vertex_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
+fragment void fragment_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
+kernel void compute_main() {
+ inverseSqrt_b197b1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..2d8c81c
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%inverseSqrt_b197b1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 InverseSqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %inverseSqrt_b197b1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %inverseSqrt_b197b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %inverseSqrt_b197b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..0025c34
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn inverseSqrt_b197b1() {
+ var res : vec3<f32> = inverseSqrt(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_b197b1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_b197b1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_b197b1();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl
new file mode 100644
index 0000000..35a6a14
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn inverseSqrt_c22347() {
+ var res: vec4<f32> = inverseSqrt(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_c22347();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_c22347();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_c22347();
+}
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl
new file mode 100644
index 0000000..28b66a7
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void inverseSqrt_c22347() {
+ float4 res = rsqrt(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
+void fragment_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl
new file mode 100644
index 0000000..a8f49da
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_c22347() {
+ float4 res = rsqrt(float4());
+}
+
+vertex void vertex_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
+fragment void fragment_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
+kernel void compute_main() {
+ inverseSqrt_c22347();
+ return;
+}
+
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm
new file mode 100644
index 0000000..55bfc48
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %inverseSqrt_c22347 "inverseSqrt_c22347"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%inverseSqrt_c22347 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 InverseSqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %inverseSqrt_c22347
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %inverseSqrt_c22347
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %inverseSqrt_c22347
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl
new file mode 100644
index 0000000..268014f
--- /dev/null
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn inverseSqrt_c22347() {
+ var res : vec4<f32> = inverseSqrt(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ inverseSqrt_c22347();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ inverseSqrt_c22347();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ inverseSqrt_c22347();
+}
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl
new file mode 100644
index 0000000..f156daf
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isFinite_34d32b() {
+ var res: vec2<bool> = isFinite(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_34d32b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_34d32b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_34d32b();
+}
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl
new file mode 100644
index 0000000..e700d05
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isFinite_34d32b() {
+ vector<bool, 2> res = isfinite(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isFinite_34d32b();
+ return;
+}
+
+void fragment_main() {
+ isFinite_34d32b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isFinite_34d32b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl
new file mode 100644
index 0000000..5758537
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isFinite_34d32b() {
+ bool2 res = isfinite(float2());
+}
+
+vertex void vertex_main() {
+ isFinite_34d32b();
+ return;
+}
+
+fragment void fragment_main() {
+ isFinite_34d32b();
+ return;
+}
+
+kernel void compute_main() {
+ isFinite_34d32b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm
new file mode 100644
index 0000000..12d3501
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm
@@ -0,0 +1,58 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isFinite_34d32b "isFinite_34d32b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %19 = OpConstantNull %v2bool
+ %float_1 = OpConstant %float 1
+%isFinite_34d32b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %19
+ %14 = OpIsInf %v2bool %13
+ %15 = OpIsNan %v2bool %13
+ %16 = OpLogicalOr %v2bool %14 %15
+ %9 = OpLogicalNot %v2bool %16
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %isFinite_34d32b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isFinite_34d32b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %isFinite_34d32b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl
new file mode 100644
index 0000000..a50f43c
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isFinite_34d32b() {
+ var res : vec2<bool> = isFinite(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_34d32b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_34d32b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_34d32b();
+}
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl
new file mode 100644
index 0000000..72f866b
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isFinite_426f9f() {
+ var res: bool = isFinite(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_426f9f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_426f9f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_426f9f();
+}
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl
new file mode 100644
index 0000000..83b92bf
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isFinite_426f9f() {
+ bool res = isfinite(1.0f);
+}
+
+void vertex_main() {
+ isFinite_426f9f();
+ return;
+}
+
+void fragment_main() {
+ isFinite_426f9f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isFinite_426f9f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl
new file mode 100644
index 0000000..27e7955
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isFinite_426f9f() {
+ bool res = isfinite(1.0f);
+}
+
+vertex void vertex_main() {
+ isFinite_426f9f();
+ return;
+}
+
+fragment void fragment_main() {
+ isFinite_426f9f();
+ return;
+}
+
+kernel void compute_main() {
+ isFinite_426f9f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm
new file mode 100644
index 0000000..cca7605
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isFinite_426f9f "isFinite_426f9f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %float_1 = OpConstant %float 1
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %17 = OpConstantNull %bool
+%isFinite_426f9f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %17
+ %12 = OpIsInf %bool %float_1
+ %13 = OpIsNan %bool %float_1
+ %14 = OpLogicalOr %bool %12 %13
+ %9 = OpLogicalNot %bool %14
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isFinite_426f9f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isFinite_426f9f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isFinite_426f9f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl
new file mode 100644
index 0000000..458d18f
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isFinite_426f9f() {
+ var res : bool = isFinite(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_426f9f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_426f9f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_426f9f();
+}
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl
new file mode 100644
index 0000000..06f1693
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isFinite_8a23ad() {
+ var res: vec3<bool> = isFinite(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_8a23ad();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_8a23ad();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_8a23ad();
+}
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl
new file mode 100644
index 0000000..b891553
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isFinite_8a23ad() {
+ vector<bool, 3> res = isfinite(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isFinite_8a23ad();
+ return;
+}
+
+void fragment_main() {
+ isFinite_8a23ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isFinite_8a23ad();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl
new file mode 100644
index 0000000..3bfe1d3
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isFinite_8a23ad() {
+ bool3 res = isfinite(float3());
+}
+
+vertex void vertex_main() {
+ isFinite_8a23ad();
+ return;
+}
+
+fragment void fragment_main() {
+ isFinite_8a23ad();
+ return;
+}
+
+kernel void compute_main() {
+ isFinite_8a23ad();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..45f72cf
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm
@@ -0,0 +1,58 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isFinite_8a23ad "isFinite_8a23ad"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %v3float = OpTypeVector %float 3
+ %13 = OpConstantNull %v3float
+%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %19 = OpConstantNull %v3bool
+ %float_1 = OpConstant %float 1
+%isFinite_8a23ad = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %19
+ %14 = OpIsInf %v3bool %13
+ %15 = OpIsNan %v3bool %13
+ %16 = OpLogicalOr %v3bool %14 %15
+ %9 = OpLogicalNot %v3bool %16
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %isFinite_8a23ad
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isFinite_8a23ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %isFinite_8a23ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..1cb9665
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isFinite_8a23ad() {
+ var res : vec3<bool> = isFinite(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_8a23ad();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_8a23ad();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_8a23ad();
+}
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl
new file mode 100644
index 0000000..9747c63
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isFinite_f31987() {
+ var res: vec4<bool> = isFinite(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_f31987();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_f31987();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_f31987();
+}
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl
new file mode 100644
index 0000000..6e9a1af
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isFinite_f31987() {
+ vector<bool, 4> res = isfinite(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isFinite_f31987();
+ return;
+}
+
+void fragment_main() {
+ isFinite_f31987();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isFinite_f31987();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl
new file mode 100644
index 0000000..f8184b3
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isFinite_f31987() {
+ bool4 res = isfinite(float4());
+}
+
+vertex void vertex_main() {
+ isFinite_f31987();
+ return;
+}
+
+fragment void fragment_main() {
+ isFinite_f31987();
+ return;
+}
+
+kernel void compute_main() {
+ isFinite_f31987();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm
new file mode 100644
index 0000000..20008cb
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm
@@ -0,0 +1,58 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isFinite_f31987 "isFinite_f31987"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %19 = OpConstantNull %v4bool
+ %float_1 = OpConstant %float 1
+%isFinite_f31987 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %19
+ %14 = OpIsInf %v4bool %13
+ %15 = OpIsNan %v4bool %13
+ %16 = OpLogicalOr %v4bool %14 %15
+ %9 = OpLogicalNot %v4bool %16
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %isFinite_f31987
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isFinite_f31987
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %isFinite_f31987
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl
new file mode 100644
index 0000000..63c77f5
--- /dev/null
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isFinite_f31987() {
+ var res : vec4<bool> = isFinite(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isFinite_f31987();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isFinite_f31987();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isFinite_f31987();
+}
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl
new file mode 100644
index 0000000..fb0708c
--- /dev/null
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isInf_666f2a() {
+ var res: vec3<bool> = isInf(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_666f2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_666f2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_666f2a();
+}
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl
new file mode 100644
index 0000000..7098626
--- /dev/null
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isInf_666f2a() {
+ vector<bool, 3> res = isinf(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isInf_666f2a();
+ return;
+}
+
+void fragment_main() {
+ isInf_666f2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isInf_666f2a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl
new file mode 100644
index 0000000..f2f6709
--- /dev/null
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isInf_666f2a() {
+ bool3 res = isinf(float3());
+}
+
+vertex void vertex_main() {
+ isInf_666f2a();
+ return;
+}
+
+fragment void fragment_main() {
+ isInf_666f2a();
+ return;
+}
+
+kernel void compute_main() {
+ isInf_666f2a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..b42d0f5
--- /dev/null
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isInf_666f2a "isInf_666f2a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %v3float = OpTypeVector %float 3
+ %13 = OpConstantNull %v3float
+%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %16 = OpConstantNull %v3bool
+ %float_1 = OpConstant %float 1
+%isInf_666f2a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %16
+ %9 = OpIsInf %v3bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isInf_666f2a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isInf_666f2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isInf_666f2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..aaf35df
--- /dev/null
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isInf_666f2a() {
+ var res : vec3<bool> = isInf(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_666f2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_666f2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_666f2a();
+}
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl
new file mode 100644
index 0000000..a659856
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isInf_7bd98f() {
+ var res: bool = isInf(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_7bd98f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_7bd98f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_7bd98f();
+}
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl
new file mode 100644
index 0000000..bb7d975
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isInf_7bd98f() {
+ bool res = isinf(1.0f);
+}
+
+void vertex_main() {
+ isInf_7bd98f();
+ return;
+}
+
+void fragment_main() {
+ isInf_7bd98f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isInf_7bd98f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl
new file mode 100644
index 0000000..8623d0e
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isInf_7bd98f() {
+ bool res = isinf(1.0f);
+}
+
+vertex void vertex_main() {
+ isInf_7bd98f();
+ return;
+}
+
+fragment void fragment_main() {
+ isInf_7bd98f();
+ return;
+}
+
+kernel void compute_main() {
+ isInf_7bd98f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm
new file mode 100644
index 0000000..361f0f8
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isInf_7bd98f "isInf_7bd98f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %float_1 = OpConstant %float 1
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %14 = OpConstantNull %bool
+%isInf_7bd98f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %14
+ %9 = OpIsInf %bool %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %isInf_7bd98f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %isInf_7bd98f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isInf_7bd98f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl
new file mode 100644
index 0000000..1fe501e
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isInf_7bd98f() {
+ var res : bool = isInf(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_7bd98f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_7bd98f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_7bd98f();
+}
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl
new file mode 100644
index 0000000..7462bd2
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isInf_7e81b5() {
+ var res: vec4<bool> = isInf(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_7e81b5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_7e81b5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_7e81b5();
+}
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl
new file mode 100644
index 0000000..00db4f3
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isInf_7e81b5() {
+ vector<bool, 4> res = isinf(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isInf_7e81b5();
+ return;
+}
+
+void fragment_main() {
+ isInf_7e81b5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isInf_7e81b5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl
new file mode 100644
index 0000000..331e462
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isInf_7e81b5() {
+ bool4 res = isinf(float4());
+}
+
+vertex void vertex_main() {
+ isInf_7e81b5();
+ return;
+}
+
+fragment void fragment_main() {
+ isInf_7e81b5();
+ return;
+}
+
+kernel void compute_main() {
+ isInf_7e81b5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm
new file mode 100644
index 0000000..8fc9a10
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isInf_7e81b5 "isInf_7e81b5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %16 = OpConstantNull %v4bool
+ %float_1 = OpConstant %float 1
+%isInf_7e81b5 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %16
+ %9 = OpIsInf %v4bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isInf_7e81b5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isInf_7e81b5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isInf_7e81b5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl
new file mode 100644
index 0000000..749e653
--- /dev/null
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isInf_7e81b5() {
+ var res : vec4<bool> = isInf(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_7e81b5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_7e81b5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_7e81b5();
+}
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl
new file mode 100644
index 0000000..336593b
--- /dev/null
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isInf_a46d6f() {
+ var res: vec2<bool> = isInf(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_a46d6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_a46d6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_a46d6f();
+}
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl
new file mode 100644
index 0000000..dd76a70
--- /dev/null
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isInf_a46d6f() {
+ vector<bool, 2> res = isinf(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isInf_a46d6f();
+ return;
+}
+
+void fragment_main() {
+ isInf_a46d6f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isInf_a46d6f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl
new file mode 100644
index 0000000..41925de
--- /dev/null
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isInf_a46d6f() {
+ bool2 res = isinf(float2());
+}
+
+vertex void vertex_main() {
+ isInf_a46d6f();
+ return;
+}
+
+fragment void fragment_main() {
+ isInf_a46d6f();
+ return;
+}
+
+kernel void compute_main() {
+ isInf_a46d6f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm
new file mode 100644
index 0000000..5b3fe9b
--- /dev/null
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isInf_a46d6f "isInf_a46d6f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %16 = OpConstantNull %v2bool
+ %float_1 = OpConstant %float 1
+%isInf_a46d6f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %16
+ %9 = OpIsInf %v2bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isInf_a46d6f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isInf_a46d6f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isInf_a46d6f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl
new file mode 100644
index 0000000..0166b73
--- /dev/null
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isInf_a46d6f() {
+ var res : vec2<bool> = isInf(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isInf_a46d6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isInf_a46d6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isInf_a46d6f();
+}
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl
new file mode 100644
index 0000000..5297e91
--- /dev/null
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNan_1280ab() {
+ var res: vec3<bool> = isNan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_1280ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_1280ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_1280ab();
+}
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl
new file mode 100644
index 0000000..0d6bc82
--- /dev/null
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void isNan_1280ab() {
+ vector<bool, 3> res = isnan(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isNan_1280ab();
+ return;
+}
+
+void fragment_main() {
+ isNan_1280ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isNan_1280ab();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl
new file mode 100644
index 0000000..c19b61d
--- /dev/null
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNan_1280ab() {
+ bool3 res = isnan(float3());
+}
+
+vertex void vertex_main() {
+ isNan_1280ab();
+ return;
+}
+
+fragment void fragment_main() {
+ isNan_1280ab();
+ return;
+}
+
+kernel void compute_main() {
+ isNan_1280ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..f678b42
--- /dev/null
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNan_1280ab "isNan_1280ab"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %v3float = OpTypeVector %float 3
+ %13 = OpConstantNull %v3float
+%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %16 = OpConstantNull %v3bool
+ %float_1 = OpConstant %float 1
+%isNan_1280ab = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %16
+ %9 = OpIsNan %v3bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isNan_1280ab
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isNan_1280ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isNan_1280ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..4e728d7
--- /dev/null
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNan_1280ab() {
+ var res : vec3<bool> = isNan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_1280ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_1280ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_1280ab();
+}
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl
new file mode 100644
index 0000000..fb64518
--- /dev/null
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNan_4d280d() {
+ var res: vec4<bool> = isNan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_4d280d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_4d280d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_4d280d();
+}
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl
new file mode 100644
index 0000000..3fed784
--- /dev/null
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void isNan_4d280d() {
+ vector<bool, 4> res = isnan(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isNan_4d280d();
+ return;
+}
+
+void fragment_main() {
+ isNan_4d280d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isNan_4d280d();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl
new file mode 100644
index 0000000..3b4b9e5
--- /dev/null
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNan_4d280d() {
+ bool4 res = isnan(float4());
+}
+
+vertex void vertex_main() {
+ isNan_4d280d();
+ return;
+}
+
+fragment void fragment_main() {
+ isNan_4d280d();
+ return;
+}
+
+kernel void compute_main() {
+ isNan_4d280d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm
new file mode 100644
index 0000000..39e7edd
--- /dev/null
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNan_4d280d "isNan_4d280d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %16 = OpConstantNull %v4bool
+ %float_1 = OpConstant %float 1
+%isNan_4d280d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %16
+ %9 = OpIsNan %v4bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isNan_4d280d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isNan_4d280d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isNan_4d280d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl
new file mode 100644
index 0000000..f0acfc5
--- /dev/null
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNan_4d280d() {
+ var res : vec4<bool> = isNan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_4d280d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_4d280d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_4d280d();
+}
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl
new file mode 100644
index 0000000..030cd01
--- /dev/null
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNan_67ecd3() {
+ var res: vec2<bool> = isNan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_67ecd3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_67ecd3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_67ecd3();
+}
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl
new file mode 100644
index 0000000..9850d57
--- /dev/null
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl
@@ -0,0 +1,31 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+void isNan_67ecd3() {
+ vector<bool, 2> res = isnan(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ isNan_67ecd3();
+ return;
+}
+
+void fragment_main() {
+ isNan_67ecd3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isNan_67ecd3();
+ return;
+}
+
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
+
+dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::ConstantFP*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl
new file mode 100644
index 0000000..66587ba
--- /dev/null
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNan_67ecd3() {
+ bool2 res = isnan(float2());
+}
+
+vertex void vertex_main() {
+ isNan_67ecd3();
+ return;
+}
+
+fragment void fragment_main() {
+ isNan_67ecd3();
+ return;
+}
+
+kernel void compute_main() {
+ isNan_67ecd3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm
new file mode 100644
index 0000000..de78ebc
--- /dev/null
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNan_67ecd3 "isNan_67ecd3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %16 = OpConstantNull %v2bool
+ %float_1 = OpConstant %float 1
+%isNan_67ecd3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %16
+ %9 = OpIsNan %v2bool %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %isNan_67ecd3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isNan_67ecd3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %isNan_67ecd3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl
new file mode 100644
index 0000000..dcdd0de
--- /dev/null
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNan_67ecd3() {
+ var res : vec2<bool> = isNan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_67ecd3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_67ecd3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_67ecd3();
+}
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl
new file mode 100644
index 0000000..ca06e23
--- /dev/null
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNan_e4978e() {
+ var res: bool = isNan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_e4978e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_e4978e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_e4978e();
+}
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl
new file mode 100644
index 0000000..cf183f7
--- /dev/null
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void isNan_e4978e() {
+ bool res = isnan(1.0f);
+}
+
+void vertex_main() {
+ isNan_e4978e();
+ return;
+}
+
+void fragment_main() {
+ isNan_e4978e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ isNan_e4978e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl
new file mode 100644
index 0000000..b308160
--- /dev/null
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNan_e4978e() {
+ bool res = isnan(1.0f);
+}
+
+vertex void vertex_main() {
+ isNan_e4978e();
+ return;
+}
+
+fragment void fragment_main() {
+ isNan_e4978e();
+ return;
+}
+
+kernel void compute_main() {
+ isNan_e4978e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm
new file mode 100644
index 0000000..c8cf7ca
--- /dev/null
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNan_e4978e "isNan_e4978e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %float_1 = OpConstant %float 1
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %14 = OpConstantNull %bool
+%isNan_e4978e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %14
+ %9 = OpIsNan %bool %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %isNan_e4978e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %isNan_e4978e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %isNan_e4978e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl
new file mode 100644
index 0000000..ecdc24f
--- /dev/null
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNan_e4978e() {
+ var res : bool = isNan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNan_e4978e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNan_e4978e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNan_e4978e();
+}
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl
new file mode 100644
index 0000000..7098af1
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNormal_863dcd() {
+ var res: vec4<bool> = isNormal(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_863dcd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_863dcd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_863dcd();
+}
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl
new file mode 100644
index 0000000..b4a5d83
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn isNormal_863dcd() {
+ var res : vec4<bool> = isNormal(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_863dcd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_863dcd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_863dcd();
+}
+
+Failed to generate: error: is_normal not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl
new file mode 100644
index 0000000..864e4ef
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNormal_863dcd() {
+ bool4 res = isnormal(float4());
+}
+
+vertex void vertex_main() {
+ isNormal_863dcd();
+ return;
+}
+
+fragment void fragment_main() {
+ isNormal_863dcd();
+ return;
+}
+
+kernel void compute_main() {
+ isNormal_863dcd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm
new file mode 100644
index 0000000..9d47ef5
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNormal_863dcd "isNormal_863dcd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+ %uint = OpTypeInt 32 0
+%uint_133693440 = OpConstant %uint 133693440
+%uint_524288 = OpConstant %uint 524288
+%uint_133169152 = OpConstant %uint 133169152
+ %v4uint = OpTypeVector %uint 4
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %28 = OpConstantNull %v4bool
+ %float_1 = OpConstant %float 1
+%isNormal_863dcd = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %28
+ %20 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440
+ %21 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288
+ %22 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152
+ %23 = OpBitcast %v4uint %13
+ %24 = OpBitwiseAnd %v4uint %23 %20
+ %25 = OpExtInst %v4uint %14 UClamp %24 %21 %22
+ %9 = OpIEqual %v4bool %24 %25
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %isNormal_863dcd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isNormal_863dcd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %isNormal_863dcd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl
new file mode 100644
index 0000000..f81cfef
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNormal_863dcd() {
+ var res : vec4<bool> = isNormal(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_863dcd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_863dcd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_863dcd();
+}
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl
new file mode 100644
index 0000000..cb819a6
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNormal_b00ab1() {
+ var res: vec2<bool> = isNormal(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_b00ab1();
+}
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl
new file mode 100644
index 0000000..c6bca5c
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn isNormal_b00ab1() {
+ var res : vec2<bool> = isNormal(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_b00ab1();
+}
+
+Failed to generate: error: is_normal not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl
new file mode 100644
index 0000000..8f1c9dd
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNormal_b00ab1() {
+ bool2 res = isnormal(float2());
+}
+
+vertex void vertex_main() {
+ isNormal_b00ab1();
+ return;
+}
+
+fragment void fragment_main() {
+ isNormal_b00ab1();
+ return;
+}
+
+kernel void compute_main() {
+ isNormal_b00ab1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm
new file mode 100644
index 0000000..392e627
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNormal_b00ab1 "isNormal_b00ab1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+ %uint = OpTypeInt 32 0
+%uint_133693440 = OpConstant %uint 133693440
+%uint_524288 = OpConstant %uint 524288
+%uint_133169152 = OpConstant %uint 133169152
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %28 = OpConstantNull %v2bool
+ %float_1 = OpConstant %float 1
+%isNormal_b00ab1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %28
+ %20 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440
+ %21 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288
+ %22 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152
+ %23 = OpBitcast %v2uint %13
+ %24 = OpBitwiseAnd %v2uint %23 %20
+ %25 = OpExtInst %v2uint %14 UClamp %24 %21 %22
+ %9 = OpIEqual %v2bool %24 %25
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %isNormal_b00ab1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isNormal_b00ab1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %isNormal_b00ab1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl
new file mode 100644
index 0000000..c14e06d
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNormal_b00ab1() {
+ var res : vec2<bool> = isNormal(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_b00ab1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_b00ab1();
+}
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl
new file mode 100644
index 0000000..50c11aa
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNormal_c286b7() {
+ var res: vec3<bool> = isNormal(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c286b7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c286b7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c286b7();
+}
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl
new file mode 100644
index 0000000..1522bbb
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn isNormal_c286b7() {
+ var res : vec3<bool> = isNormal(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c286b7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c286b7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c286b7();
+}
+
+Failed to generate: error: is_normal not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl
new file mode 100644
index 0000000..26fc3c4
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNormal_c286b7() {
+ bool3 res = isnormal(float3());
+}
+
+vertex void vertex_main() {
+ isNormal_c286b7();
+ return;
+}
+
+fragment void fragment_main() {
+ isNormal_c286b7();
+ return;
+}
+
+kernel void compute_main() {
+ isNormal_c286b7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm
new file mode 100644
index 0000000..4ae8199
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNormal_c286b7 "isNormal_c286b7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %v3float = OpTypeVector %float 3
+ %13 = OpConstantNull %v3float
+ %uint = OpTypeInt 32 0
+%uint_133693440 = OpConstant %uint 133693440
+%uint_524288 = OpConstant %uint 524288
+%uint_133169152 = OpConstant %uint 133169152
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %28 = OpConstantNull %v3bool
+ %float_1 = OpConstant %float 1
+%isNormal_c286b7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %28
+ %20 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440
+ %21 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288
+ %22 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152
+ %23 = OpBitcast %v3uint %13
+ %24 = OpBitwiseAnd %v3uint %23 %20
+ %25 = OpExtInst %v3uint %14 UClamp %24 %21 %22
+ %9 = OpIEqual %v3bool %24 %25
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %isNormal_c286b7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isNormal_c286b7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %isNormal_c286b7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl
new file mode 100644
index 0000000..e8b0e2b
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNormal_c286b7() {
+ var res : vec3<bool> = isNormal(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c286b7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c286b7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c286b7();
+}
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl
new file mode 100644
index 0000000..9997d8c
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn isNormal_c6e880() {
+ var res: bool = isNormal(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c6e880();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c6e880();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c6e880();
+}
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl
new file mode 100644
index 0000000..c6a86ac
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn isNormal_c6e880() {
+ var res : bool = isNormal(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c6e880();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c6e880();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c6e880();
+}
+
+Failed to generate: error: is_normal not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl
new file mode 100644
index 0000000..b8dda4e
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void isNormal_c6e880() {
+ bool res = isnormal(1.0f);
+}
+
+vertex void vertex_main() {
+ isNormal_c6e880();
+ return;
+}
+
+fragment void fragment_main() {
+ isNormal_c6e880();
+ return;
+}
+
+kernel void compute_main() {
+ isNormal_c6e880();
+ return;
+}
+
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm
new file mode 100644
index 0000000..85f21bb
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %isNormal_c6e880 "isNormal_c6e880"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %float_1 = OpConstant %float 1
+ %uint = OpTypeInt 32 0
+%uint_133693440 = OpConstant %uint 133693440
+%uint_524288 = OpConstant %uint 524288
+%uint_133169152 = OpConstant %uint 133169152
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %22 = OpConstantNull %bool
+%isNormal_c6e880 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %22
+ %17 = OpBitcast %uint %float_1
+ %18 = OpBitwiseAnd %uint %17 %uint_133693440
+ %19 = OpExtInst %uint %12 UClamp %18 %uint_524288 %uint_133169152
+ %9 = OpIEqual %bool %18 %19
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %isNormal_c6e880
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %isNormal_c6e880
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %isNormal_c6e880
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl
new file mode 100644
index 0000000..5218aec
--- /dev/null
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn isNormal_c6e880() {
+ var res : bool = isNormal(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ isNormal_c6e880();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ isNormal_c6e880();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ isNormal_c6e880();
+}
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl
new file mode 100644
index 0000000..46ca343
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_2cb32a() {
+ var res: vec3<f32> = ldexp(vec3<f32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_2cb32a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_2cb32a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_2cb32a();
+}
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl
new file mode 100644
index 0000000..60b2ca1
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_2cb32a() {
+ float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ ldexp_2cb32a();
+ return;
+}
+
+void fragment_main() {
+ ldexp_2cb32a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_2cb32a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl
new file mode 100644
index 0000000..da77958
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl
@@ -0,0 +1,56 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_2cb32a() {
+ float3 res = ldexp(float3(), uint3());
+}
+
+vertex void vertex_main() {
+ ldexp_2cb32a();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_2cb32a();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_2cb32a();
+ return;
+}
+
+
+tint_UUwNAv.metal:5:18: error: no matching function for call to 'ldexp'
+ float3 res = ldexp(float3(), uint3());
+ ^~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'uint3' (vector of 3 'unsigned int' values) to 'metal::int3' (aka 'int3') for 2nd argument
+METAL_FUNC float3 ldexp(float3 x, int3 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'half' for 1st argument
+METAL_FUNC half ldexp(half x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
+METAL_FUNC half2 ldexp(half2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
+METAL_FUNC half3 ldexp(half3 x, int3 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
+METAL_FUNC half4 ldexp(half4 x, int4 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'float' for 1st argument
+METAL_FUNC float ldexp(float x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float2' (aka 'float2') for 1st argument
+METAL_FUNC float2 ldexp(float2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float4' (aka 'float4') for 1st argument
+METAL_FUNC float4 ldexp(float4 x, int4 k)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm
new file mode 100644
index 0000000..7d726b1
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_2cb32a "ldexp_2cb32a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %15 = OpConstantNull %v3uint
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%ldexp_2cb32a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_2cb32a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_2cb32a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_2cb32a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl
new file mode 100644
index 0000000..7a2d880
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_2cb32a() {
+ var res : vec3<f32> = ldexp(vec3<f32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_2cb32a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_2cb32a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_2cb32a();
+}
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl
new file mode 100644
index 0000000..721a215
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_4d6f6d() {
+ var res: vec4<f32> = ldexp(vec4<f32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_4d6f6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_4d6f6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_4d6f6d();
+}
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl
new file mode 100644
index 0000000..34a11dc
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_4d6f6d() {
+ float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
+void fragment_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl
new file mode 100644
index 0000000..f65466e
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl
@@ -0,0 +1,56 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_4d6f6d() {
+ float4 res = ldexp(float4(), uint4());
+}
+
+vertex void vertex_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_4d6f6d();
+ return;
+}
+
+
+tint_51Pgfs.metal:5:18: error: no matching function for call to 'ldexp'
+ float4 res = ldexp(float4(), uint4());
+ ^~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'uint4' (vector of 4 'unsigned int' values) to 'metal::int4' (aka 'int4') for 2nd argument
+METAL_FUNC float4 ldexp(float4 x, int4 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'half' for 1st argument
+METAL_FUNC half ldexp(half x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
+METAL_FUNC half2 ldexp(half2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
+METAL_FUNC half3 ldexp(half3 x, int3 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
+METAL_FUNC half4 ldexp(half4 x, int4 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'float' for 1st argument
+METAL_FUNC float ldexp(float x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float2' (aka 'float2') for 1st argument
+METAL_FUNC float2 ldexp(float2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float3' (aka 'float3') for 1st argument
+METAL_FUNC float3 ldexp(float3 x, int3 k)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm
new file mode 100644
index 0000000..15284e6
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_4d6f6d "ldexp_4d6f6d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %15 = OpConstantNull %v4uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%ldexp_4d6f6d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_4d6f6d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_4d6f6d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_4d6f6d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl
new file mode 100644
index 0000000..50dc307
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_4d6f6d() {
+ var res : vec4<f32> = ldexp(vec4<f32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_4d6f6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_4d6f6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_4d6f6d();
+}
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl
new file mode 100644
index 0000000..f3de6a9
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_7bc2fd() {
+ var res: vec2<f32> = ldexp(vec2<f32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_7bc2fd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_7bc2fd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_7bc2fd();
+}
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl
new file mode 100644
index 0000000..b5ec607
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_7bc2fd() {
+ float2 res = ldexp(float2(0.0f, 0.0f), uint2(0u, 0u));
+}
+
+void vertex_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
+void fragment_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl
new file mode 100644
index 0000000..940c232
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl
@@ -0,0 +1,56 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_7bc2fd() {
+ float2 res = ldexp(float2(), uint2());
+}
+
+vertex void vertex_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_7bc2fd();
+ return;
+}
+
+
+tint_aJWI1V.metal:5:18: error: no matching function for call to 'ldexp'
+ float2 res = ldexp(float2(), uint2());
+ ^~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'uint2' (vector of 2 'unsigned int' values) to 'metal::int2' (aka 'int2') for 2nd argument
+METAL_FUNC float2 ldexp(float2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'half' for 1st argument
+METAL_FUNC half ldexp(half x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half2' (aka 'half2') for 1st argument
+METAL_FUNC half2 ldexp(half2 x, int2 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half3' (aka 'half3') for 1st argument
+METAL_FUNC half3 ldexp(half3 x, int3 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half4' (aka 'half4') for 1st argument
+METAL_FUNC half4 ldexp(half4 x, int4 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float' for 1st argument
+METAL_FUNC float ldexp(float x, int k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float3' (aka 'float3') for 1st argument
+METAL_FUNC float3 ldexp(float3 x, int3 k)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float4' (aka 'float4') for 1st argument
+METAL_FUNC float4 ldexp(float4 x, int4 k)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm
new file mode 100644
index 0000000..e91a0d4
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_7bc2fd "ldexp_7bc2fd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %15 = OpConstantNull %v2uint
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%ldexp_7bc2fd = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_7bc2fd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_7bc2fd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_7bc2fd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl
new file mode 100644
index 0000000..3f6c48e
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_7bc2fd() {
+ var res : vec2<f32> = ldexp(vec2<f32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_7bc2fd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_7bc2fd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_7bc2fd();
+}
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl
new file mode 100644
index 0000000..54dd690
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_a31cdc() {
+ var res: vec3<f32> = ldexp(vec3<f32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_a31cdc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_a31cdc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_a31cdc();
+}
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl
new file mode 100644
index 0000000..a099927
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_a31cdc() {
+ float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0));
+}
+
+void vertex_main() {
+ ldexp_a31cdc();
+ return;
+}
+
+void fragment_main() {
+ ldexp_a31cdc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_a31cdc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl
new file mode 100644
index 0000000..a535583
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_a31cdc() {
+ float3 res = ldexp(float3(), int3());
+}
+
+vertex void vertex_main() {
+ ldexp_a31cdc();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_a31cdc();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_a31cdc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm
new file mode 100644
index 0000000..07a38eb
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_a31cdc "ldexp_a31cdc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %15 = OpConstantNull %v3int
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%ldexp_a31cdc = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_a31cdc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_a31cdc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_a31cdc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl
new file mode 100644
index 0000000..788cab2
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_a31cdc() {
+ var res : vec3<f32> = ldexp(vec3<f32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_a31cdc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_a31cdc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_a31cdc();
+}
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl
new file mode 100644
index 0000000..7a5eef1
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_abd718() {
+ var res: vec2<f32> = ldexp(vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_abd718();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_abd718();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_abd718();
+}
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl
new file mode 100644
index 0000000..af7d67b
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_abd718() {
+ float2 res = ldexp(float2(0.0f, 0.0f), int2(0, 0));
+}
+
+void vertex_main() {
+ ldexp_abd718();
+ return;
+}
+
+void fragment_main() {
+ ldexp_abd718();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_abd718();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl
new file mode 100644
index 0000000..86338d3
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_abd718() {
+ float2 res = ldexp(float2(), int2());
+}
+
+vertex void vertex_main() {
+ ldexp_abd718();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_abd718();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_abd718();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d84f62
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_abd718 "ldexp_abd718"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %15 = OpConstantNull %v2int
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%ldexp_abd718 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_abd718
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_abd718
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_abd718
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl
new file mode 100644
index 0000000..8d38ecd
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_abd718() {
+ var res : vec2<f32> = ldexp(vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_abd718();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_abd718();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_abd718();
+}
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl
new file mode 100644
index 0000000..12d88ce
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_cc9cde() {
+ var res: vec4<f32> = ldexp(vec4<f32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_cc9cde();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_cc9cde();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_cc9cde();
+}
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl
new file mode 100644
index 0000000..8134010
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_cc9cde() {
+ float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ ldexp_cc9cde();
+ return;
+}
+
+void fragment_main() {
+ ldexp_cc9cde();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_cc9cde();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl
new file mode 100644
index 0000000..59232fd
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_cc9cde() {
+ float4 res = ldexp(float4(), int4());
+}
+
+vertex void vertex_main() {
+ ldexp_cc9cde();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_cc9cde();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_cc9cde();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm
new file mode 100644
index 0000000..085dc1a
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm
@@ -0,0 +1,56 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_cc9cde "ldexp_cc9cde"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %15 = OpConstantNull %v4int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%ldexp_cc9cde = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Ldexp %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %ldexp_cc9cde
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_cc9cde
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %ldexp_cc9cde
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl
new file mode 100644
index 0000000..5db48ce
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_cc9cde() {
+ var res : vec4<f32> = ldexp(vec4<f32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_cc9cde();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_cc9cde();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_cc9cde();
+}
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl
new file mode 100644
index 0000000..97f4987
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_db8b49() {
+ var res: f32 = ldexp(1.0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_db8b49();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_db8b49();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_db8b49();
+}
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl
new file mode 100644
index 0000000..db60414
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_db8b49() {
+ float res = ldexp(1.0f, 1);
+}
+
+void vertex_main() {
+ ldexp_db8b49();
+ return;
+}
+
+void fragment_main() {
+ ldexp_db8b49();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_db8b49();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl
new file mode 100644
index 0000000..08368a3
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_db8b49() {
+ float res = ldexp(1.0f, 1);
+}
+
+vertex void vertex_main() {
+ ldexp_db8b49();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_db8b49();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_db8b49();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm
new file mode 100644
index 0000000..fd415e6
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_db8b49 "ldexp_db8b49"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+%ldexp_db8b49 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Ldexp %float_1 %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %ldexp_db8b49
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %ldexp_db8b49
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_db8b49
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl
new file mode 100644
index 0000000..cc84308
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_db8b49() {
+ var res : f32 = ldexp(1.0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_db8b49();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_db8b49();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_db8b49();
+}
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl
new file mode 100644
index 0000000..dfe420a
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn ldexp_f54ff2() {
+ var res: f32 = ldexp(1.0, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_f54ff2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_f54ff2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_f54ff2();
+}
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl
new file mode 100644
index 0000000..d674b8d
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void ldexp_f54ff2() {
+ float res = ldexp(1.0f, 1u);
+}
+
+void vertex_main() {
+ ldexp_f54ff2();
+ return;
+}
+
+void fragment_main() {
+ ldexp_f54ff2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ ldexp_f54ff2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl
new file mode 100644
index 0000000..4980cea
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void ldexp_f54ff2() {
+ float res = ldexp(1.0f, 1u);
+}
+
+vertex void vertex_main() {
+ ldexp_f54ff2();
+ return;
+}
+
+fragment void fragment_main() {
+ ldexp_f54ff2();
+ return;
+}
+
+kernel void compute_main() {
+ ldexp_f54ff2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm
new file mode 100644
index 0000000..6d449b0
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %ldexp_f54ff2 "ldexp_f54ff2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_float = OpTypePointer Function %float
+%ldexp_f54ff2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Ldexp %float_1 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %ldexp_f54ff2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %ldexp_f54ff2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %ldexp_f54ff2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl
new file mode 100644
index 0000000..aea15a0
--- /dev/null
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn ldexp_f54ff2() {
+ var res : f32 = ldexp(1.0, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ ldexp_f54ff2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ ldexp_f54ff2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ ldexp_f54ff2();
+}
diff --git a/test/intrinsics/gen/length/056071.wgsl b/test/intrinsics/gen/length/056071.wgsl
new file mode 100644
index 0000000..61c6111
--- /dev/null
+++ b/test/intrinsics/gen/length/056071.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn length_056071() {
+ var res: f32 = length(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_056071();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_056071();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_056071();
+}
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl
new file mode 100644
index 0000000..a3ffa2a
--- /dev/null
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void length_056071() {
+ float res = length(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ length_056071();
+ return;
+}
+
+void fragment_main() {
+ length_056071();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ length_056071();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.msl b/test/intrinsics/gen/length/056071.wgsl.expected.msl
new file mode 100644
index 0000000..5ea9ae9
--- /dev/null
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void length_056071() {
+ float res = length(float3());
+}
+
+vertex void vertex_main() {
+ length_056071();
+ return;
+}
+
+fragment void fragment_main() {
+ length_056071();
+ return;
+}
+
+kernel void compute_main() {
+ length_056071();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm
new file mode 100644
index 0000000..8fd8983
--- /dev/null
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %length_056071 "length_056071"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%length_056071 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Length %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %length_056071
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %length_056071
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %length_056071
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl
new file mode 100644
index 0000000..76b3aa8
--- /dev/null
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn length_056071() {
+ var res : f32 = length(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_056071();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_056071();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_056071();
+}
diff --git a/test/intrinsics/gen/length/602a17.wgsl b/test/intrinsics/gen/length/602a17.wgsl
new file mode 100644
index 0000000..6f5d3b5
--- /dev/null
+++ b/test/intrinsics/gen/length/602a17.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn length_602a17() {
+ var res: f32 = length(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_602a17();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_602a17();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_602a17();
+}
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl
new file mode 100644
index 0000000..db461f8
--- /dev/null
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void length_602a17() {
+ float res = length(1.0f);
+}
+
+void vertex_main() {
+ length_602a17();
+ return;
+}
+
+void fragment_main() {
+ length_602a17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ length_602a17();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.msl b/test/intrinsics/gen/length/602a17.wgsl.expected.msl
new file mode 100644
index 0000000..38e7b33
--- /dev/null
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.msl
@@ -0,0 +1,50 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void length_602a17() {
+ float res = length(1.0f);
+}
+
+vertex void vertex_main() {
+ length_602a17();
+ return;
+}
+
+fragment void fragment_main() {
+ length_602a17();
+ return;
+}
+
+kernel void compute_main() {
+ length_602a17();
+ return;
+}
+
+
+tint_bg8DxD.metal:5:17: error: call to 'length' is ambiguous
+ float res = length(1.0f);
+ ^~~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:295:17: note: candidate function
+METAL_FUNC half length(half2 x)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:326:17: note: candidate function
+METAL_FUNC half length(half3 x)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:357:17: note: candidate function
+METAL_FUNC half length(half4 x)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:388:18: note: candidate function
+METAL_FUNC float length(float2 x)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:431:18: note: candidate function
+METAL_FUNC float length(float3 x)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:474:18: note: candidate function
+METAL_FUNC float length(float4 x)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm
new file mode 100644
index 0000000..68516f0
--- /dev/null
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %length_602a17 "length_602a17"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%length_602a17 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Length %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %length_602a17
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %length_602a17
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %length_602a17
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl
new file mode 100644
index 0000000..2b6b9e9
--- /dev/null
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn length_602a17() {
+ var res : f32 = length(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_602a17();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_602a17();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_602a17();
+}
diff --git a/test/intrinsics/gen/length/afde8b.wgsl b/test/intrinsics/gen/length/afde8b.wgsl
new file mode 100644
index 0000000..fde4834
--- /dev/null
+++ b/test/intrinsics/gen/length/afde8b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn length_afde8b() {
+ var res: f32 = length(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_afde8b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_afde8b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_afde8b();
+}
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl
new file mode 100644
index 0000000..005dc5a
--- /dev/null
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void length_afde8b() {
+ float res = length(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ length_afde8b();
+ return;
+}
+
+void fragment_main() {
+ length_afde8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ length_afde8b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl
new file mode 100644
index 0000000..56514b1
--- /dev/null
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void length_afde8b() {
+ float res = length(float2());
+}
+
+vertex void vertex_main() {
+ length_afde8b();
+ return;
+}
+
+fragment void fragment_main() {
+ length_afde8b();
+ return;
+}
+
+kernel void compute_main() {
+ length_afde8b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm
new file mode 100644
index 0000000..70f5d76
--- /dev/null
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %length_afde8b "length_afde8b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%length_afde8b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Length %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %length_afde8b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %length_afde8b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %length_afde8b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl
new file mode 100644
index 0000000..052f0af
--- /dev/null
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn length_afde8b() {
+ var res : f32 = length(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_afde8b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_afde8b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_afde8b();
+}
diff --git a/test/intrinsics/gen/length/becebf.wgsl b/test/intrinsics/gen/length/becebf.wgsl
new file mode 100644
index 0000000..447d82e
--- /dev/null
+++ b/test/intrinsics/gen/length/becebf.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn length_becebf() {
+ var res: f32 = length(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_becebf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_becebf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_becebf();
+}
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl
new file mode 100644
index 0000000..a1c4197
--- /dev/null
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void length_becebf() {
+ float res = length(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ length_becebf();
+ return;
+}
+
+void fragment_main() {
+ length_becebf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ length_becebf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.msl b/test/intrinsics/gen/length/becebf.wgsl.expected.msl
new file mode 100644
index 0000000..a63f31a
--- /dev/null
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void length_becebf() {
+ float res = length(float4());
+}
+
+vertex void vertex_main() {
+ length_becebf();
+ return;
+}
+
+fragment void fragment_main() {
+ length_becebf();
+ return;
+}
+
+kernel void compute_main() {
+ length_becebf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm
new file mode 100644
index 0000000..48be6d3
--- /dev/null
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %length_becebf "length_becebf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%length_becebf = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Length %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %length_becebf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %length_becebf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %length_becebf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl
new file mode 100644
index 0000000..c8a2c42
--- /dev/null
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn length_becebf() {
+ var res : f32 = length(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ length_becebf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ length_becebf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ length_becebf();
+}
diff --git a/test/intrinsics/gen/log/3da25a.wgsl b/test/intrinsics/gen/log/3da25a.wgsl
new file mode 100644
index 0000000..07716b2
--- /dev/null
+++ b/test/intrinsics/gen/log/3da25a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log_3da25a() {
+ var res: vec4<f32> = log(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_3da25a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_3da25a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_3da25a();
+}
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl
new file mode 100644
index 0000000..7a247e3
--- /dev/null
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log_3da25a() {
+ float4 res = log(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log_3da25a();
+ return;
+}
+
+void fragment_main() {
+ log_3da25a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log_3da25a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl
new file mode 100644
index 0000000..ff81127
--- /dev/null
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log_3da25a() {
+ float4 res = log(float4());
+}
+
+vertex void vertex_main() {
+ log_3da25a();
+ return;
+}
+
+fragment void fragment_main() {
+ log_3da25a();
+ return;
+}
+
+kernel void compute_main() {
+ log_3da25a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm
new file mode 100644
index 0000000..3d66145
--- /dev/null
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log_3da25a "log_3da25a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %log_3da25a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Log %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log_3da25a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log_3da25a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log_3da25a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl
new file mode 100644
index 0000000..452e71c
--- /dev/null
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log_3da25a() {
+ var res : vec4<f32> = log(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_3da25a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_3da25a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_3da25a();
+}
diff --git a/test/intrinsics/gen/log/7114a6.wgsl b/test/intrinsics/gen/log/7114a6.wgsl
new file mode 100644
index 0000000..bac8f95
--- /dev/null
+++ b/test/intrinsics/gen/log/7114a6.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log_7114a6() {
+ var res: f32 = log(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_7114a6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_7114a6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_7114a6();
+}
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl
new file mode 100644
index 0000000..e1f96d2
--- /dev/null
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log_7114a6() {
+ float res = log(1.0f);
+}
+
+void vertex_main() {
+ log_7114a6();
+ return;
+}
+
+void fragment_main() {
+ log_7114a6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log_7114a6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl
new file mode 100644
index 0000000..e052391
--- /dev/null
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log_7114a6() {
+ float res = log(1.0f);
+}
+
+vertex void vertex_main() {
+ log_7114a6();
+ return;
+}
+
+fragment void fragment_main() {
+ log_7114a6();
+ return;
+}
+
+kernel void compute_main() {
+ log_7114a6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm
new file mode 100644
index 0000000..fd0a41c
--- /dev/null
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log_7114a6 "log_7114a6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %log_7114a6 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Log %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %log_7114a6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %log_7114a6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %log_7114a6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl
new file mode 100644
index 0000000..9887a63
--- /dev/null
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log_7114a6() {
+ var res : f32 = log(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_7114a6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_7114a6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_7114a6();
+}
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl
new file mode 100644
index 0000000..540615d
--- /dev/null
+++ b/test/intrinsics/gen/log/b2ce28.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log_b2ce28() {
+ var res: vec2<f32> = log(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_b2ce28();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_b2ce28();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_b2ce28();
+}
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl
new file mode 100644
index 0000000..0e6d75d
--- /dev/null
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log_b2ce28() {
+ float2 res = log(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log_b2ce28();
+ return;
+}
+
+void fragment_main() {
+ log_b2ce28();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log_b2ce28();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl
new file mode 100644
index 0000000..69f048a
--- /dev/null
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log_b2ce28() {
+ float2 res = log(float2());
+}
+
+vertex void vertex_main() {
+ log_b2ce28();
+ return;
+}
+
+fragment void fragment_main() {
+ log_b2ce28();
+ return;
+}
+
+kernel void compute_main() {
+ log_b2ce28();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm
new file mode 100644
index 0000000..3615a64
--- /dev/null
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log_b2ce28 "log_b2ce28"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %log_b2ce28 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Log %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log_b2ce28
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log_b2ce28
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log_b2ce28
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e98760
--- /dev/null
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log_b2ce28() {
+ var res : vec2<f32> = log(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_b2ce28();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_b2ce28();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_b2ce28();
+}
diff --git a/test/intrinsics/gen/log/f4c570.wgsl b/test/intrinsics/gen/log/f4c570.wgsl
new file mode 100644
index 0000000..70a5b35
--- /dev/null
+++ b/test/intrinsics/gen/log/f4c570.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log_f4c570() {
+ var res: vec3<f32> = log(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_f4c570();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_f4c570();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_f4c570();
+}
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl
new file mode 100644
index 0000000..92b5439
--- /dev/null
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log_f4c570() {
+ float3 res = log(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log_f4c570();
+ return;
+}
+
+void fragment_main() {
+ log_f4c570();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log_f4c570();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl
new file mode 100644
index 0000000..e1b3061
--- /dev/null
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log_f4c570() {
+ float3 res = log(float3());
+}
+
+vertex void vertex_main() {
+ log_f4c570();
+ return;
+}
+
+fragment void fragment_main() {
+ log_f4c570();
+ return;
+}
+
+kernel void compute_main() {
+ log_f4c570();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm
new file mode 100644
index 0000000..367cee2
--- /dev/null
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log_f4c570 "log_f4c570"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %log_f4c570 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Log %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log_f4c570
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log_f4c570
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log_f4c570
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl
new file mode 100644
index 0000000..57a2f17
--- /dev/null
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log_f4c570() {
+ var res : vec3<f32> = log(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log_f4c570();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log_f4c570();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log_f4c570();
+}
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl
new file mode 100644
index 0000000..12a5124
--- /dev/null
+++ b/test/intrinsics/gen/log2/4036ed.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log2_4036ed() {
+ var res: f32 = log2(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_4036ed();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_4036ed();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_4036ed();
+}
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl
new file mode 100644
index 0000000..64d6c00
--- /dev/null
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log2_4036ed() {
+ float res = log2(1.0f);
+}
+
+void vertex_main() {
+ log2_4036ed();
+ return;
+}
+
+void fragment_main() {
+ log2_4036ed();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log2_4036ed();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl
new file mode 100644
index 0000000..30658f2
--- /dev/null
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log2_4036ed() {
+ float res = log2(1.0f);
+}
+
+vertex void vertex_main() {
+ log2_4036ed();
+ return;
+}
+
+fragment void fragment_main() {
+ log2_4036ed();
+ return;
+}
+
+kernel void compute_main() {
+ log2_4036ed();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm
new file mode 100644
index 0000000..25873c2
--- /dev/null
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log2_4036ed "log2_4036ed"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%log2_4036ed = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Log2 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %log2_4036ed
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %log2_4036ed
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %log2_4036ed
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl
new file mode 100644
index 0000000..c188875
--- /dev/null
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log2_4036ed() {
+ var res : f32 = log2(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_4036ed();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_4036ed();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_4036ed();
+}
diff --git a/test/intrinsics/gen/log2/902988.wgsl b/test/intrinsics/gen/log2/902988.wgsl
new file mode 100644
index 0000000..37fa435
--- /dev/null
+++ b/test/intrinsics/gen/log2/902988.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log2_902988() {
+ var res: vec4<f32> = log2(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_902988();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_902988();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_902988();
+}
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl
new file mode 100644
index 0000000..cf1503f
--- /dev/null
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log2_902988() {
+ float4 res = log2(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log2_902988();
+ return;
+}
+
+void fragment_main() {
+ log2_902988();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log2_902988();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.msl b/test/intrinsics/gen/log2/902988.wgsl.expected.msl
new file mode 100644
index 0000000..4a9bd89
--- /dev/null
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log2_902988() {
+ float4 res = log2(float4());
+}
+
+vertex void vertex_main() {
+ log2_902988();
+ return;
+}
+
+fragment void fragment_main() {
+ log2_902988();
+ return;
+}
+
+kernel void compute_main() {
+ log2_902988();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm
new file mode 100644
index 0000000..bab1daa
--- /dev/null
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log2_902988 "log2_902988"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%log2_902988 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Log2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log2_902988
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log2_902988
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log2_902988
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f4b264
--- /dev/null
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log2_902988() {
+ var res : vec4<f32> = log2(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_902988();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_902988();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_902988();
+}
diff --git a/test/intrinsics/gen/log2/adb233.wgsl b/test/intrinsics/gen/log2/adb233.wgsl
new file mode 100644
index 0000000..54b7dc3
--- /dev/null
+++ b/test/intrinsics/gen/log2/adb233.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log2_adb233() {
+ var res: vec3<f32> = log2(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_adb233();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_adb233();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_adb233();
+}
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl
new file mode 100644
index 0000000..d78b713
--- /dev/null
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log2_adb233() {
+ float3 res = log2(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log2_adb233();
+ return;
+}
+
+void fragment_main() {
+ log2_adb233();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log2_adb233();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl
new file mode 100644
index 0000000..8e122aa
--- /dev/null
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log2_adb233() {
+ float3 res = log2(float3());
+}
+
+vertex void vertex_main() {
+ log2_adb233();
+ return;
+}
+
+fragment void fragment_main() {
+ log2_adb233();
+ return;
+}
+
+kernel void compute_main() {
+ log2_adb233();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm
new file mode 100644
index 0000000..60d3c54
--- /dev/null
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log2_adb233 "log2_adb233"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%log2_adb233 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Log2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log2_adb233
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log2_adb233
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log2_adb233
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl
new file mode 100644
index 0000000..1b6e0ca
--- /dev/null
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log2_adb233() {
+ var res : vec3<f32> = log2(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_adb233();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_adb233();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_adb233();
+}
diff --git a/test/intrinsics/gen/log2/aea659.wgsl b/test/intrinsics/gen/log2/aea659.wgsl
new file mode 100644
index 0000000..b9d25e4
--- /dev/null
+++ b/test/intrinsics/gen/log2/aea659.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn log2_aea659() {
+ var res: vec2<f32> = log2(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_aea659();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_aea659();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_aea659();
+}
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl
new file mode 100644
index 0000000..d4bf6ed
--- /dev/null
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void log2_aea659() {
+ float2 res = log2(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ log2_aea659();
+ return;
+}
+
+void fragment_main() {
+ log2_aea659();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ log2_aea659();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl
new file mode 100644
index 0000000..fa4ade2
--- /dev/null
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void log2_aea659() {
+ float2 res = log2(float2());
+}
+
+vertex void vertex_main() {
+ log2_aea659();
+ return;
+}
+
+fragment void fragment_main() {
+ log2_aea659();
+ return;
+}
+
+kernel void compute_main() {
+ log2_aea659();
+ return;
+}
+
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm
new file mode 100644
index 0000000..ac0c815
--- /dev/null
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %log2_aea659 "log2_aea659"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%log2_aea659 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Log2 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %log2_aea659
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %log2_aea659
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %log2_aea659
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl
new file mode 100644
index 0000000..f21cead
--- /dev/null
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn log2_aea659() {
+ var res : vec2<f32> = log2(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ log2_aea659();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ log2_aea659();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ log2_aea659();
+}
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl
new file mode 100644
index 0000000..e68b502
--- /dev/null
+++ b/test/intrinsics/gen/max/0c0aae.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_0c0aae() {
+ var res: u32 = max(1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_0c0aae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_0c0aae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_0c0aae();
+}
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl
new file mode 100644
index 0000000..9190770
--- /dev/null
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_0c0aae() {
+ uint res = max(1u, 1u);
+}
+
+void vertex_main() {
+ max_0c0aae();
+ return;
+}
+
+void fragment_main() {
+ max_0c0aae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_0c0aae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl
new file mode 100644
index 0000000..c70f546
--- /dev/null
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_0c0aae() {
+ uint res = max(1u, 1u);
+}
+
+vertex void vertex_main() {
+ max_0c0aae();
+ return;
+}
+
+fragment void fragment_main() {
+ max_0c0aae();
+ return;
+}
+
+kernel void compute_main() {
+ max_0c0aae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm
new file mode 100644
index 0000000..16889df
--- /dev/null
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_0c0aae "max_0c0aae"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %15 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %max_0c0aae = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %15
+ %9 = OpExtInst %uint %11 UMax %uint_1 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_0c0aae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_0c0aae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_0c0aae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl
new file mode 100644
index 0000000..911ceb0
--- /dev/null
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_0c0aae() {
+ var res : u32 = max(1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_0c0aae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_0c0aae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_0c0aae();
+}
diff --git a/test/intrinsics/gen/max/25eafe.wgsl b/test/intrinsics/gen/max/25eafe.wgsl
new file mode 100644
index 0000000..1662e9f
--- /dev/null
+++ b/test/intrinsics/gen/max/25eafe.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_25eafe() {
+ var res: vec3<i32> = max(vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_25eafe();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_25eafe();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_25eafe();
+}
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl
new file mode 100644
index 0000000..fbd6119
--- /dev/null
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_25eafe() {
+ int3 res = max(int3(0, 0, 0), int3(0, 0, 0));
+}
+
+void vertex_main() {
+ max_25eafe();
+ return;
+}
+
+void fragment_main() {
+ max_25eafe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_25eafe();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl
new file mode 100644
index 0000000..42f0ea3
--- /dev/null
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_25eafe() {
+ int3 res = max(int3(), int3());
+}
+
+vertex void vertex_main() {
+ max_25eafe();
+ return;
+}
+
+fragment void fragment_main() {
+ max_25eafe();
+ return;
+}
+
+kernel void compute_main() {
+ max_25eafe();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm
new file mode 100644
index 0000000..2e5b431
--- /dev/null
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_25eafe "max_25eafe"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %13 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+ %max_25eafe = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %13
+ %9 = OpExtInst %v3int %12 SMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_25eafe
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_25eafe
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_25eafe
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl
new file mode 100644
index 0000000..7f7ed46
--- /dev/null
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_25eafe() {
+ var res : vec3<i32> = max(vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_25eafe();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_25eafe();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_25eafe();
+}
diff --git a/test/intrinsics/gen/max/320815.wgsl b/test/intrinsics/gen/max/320815.wgsl
new file mode 100644
index 0000000..0e5a426
--- /dev/null
+++ b/test/intrinsics/gen/max/320815.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_320815() {
+ var res: vec2<u32> = max(vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_320815();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_320815();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_320815();
+}
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl
new file mode 100644
index 0000000..454bb3a
--- /dev/null
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_320815() {
+ uint2 res = max(uint2(0u, 0u), uint2(0u, 0u));
+}
+
+void vertex_main() {
+ max_320815();
+ return;
+}
+
+void fragment_main() {
+ max_320815();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_320815();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.msl b/test/intrinsics/gen/max/320815.wgsl.expected.msl
new file mode 100644
index 0000000..4f151c1
--- /dev/null
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_320815() {
+ uint2 res = max(uint2(), uint2());
+}
+
+vertex void vertex_main() {
+ max_320815();
+ return;
+}
+
+fragment void fragment_main() {
+ max_320815();
+ return;
+}
+
+kernel void compute_main() {
+ max_320815();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm
new file mode 100644
index 0000000..aaac67e
--- /dev/null
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_320815 "max_320815"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %13 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+ %max_320815 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %13
+ %9 = OpExtInst %v2uint %12 UMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_320815
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_320815
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_320815
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl
new file mode 100644
index 0000000..f99eb40
--- /dev/null
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_320815() {
+ var res : vec2<u32> = max(vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_320815();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_320815();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_320815();
+}
diff --git a/test/intrinsics/gen/max/44a39d.wgsl b/test/intrinsics/gen/max/44a39d.wgsl
new file mode 100644
index 0000000..1767a3d
--- /dev/null
+++ b/test/intrinsics/gen/max/44a39d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_44a39d() {
+ var res: f32 = max(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_44a39d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_44a39d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_44a39d();
+}
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl
new file mode 100644
index 0000000..5b3fdc3
--- /dev/null
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_44a39d() {
+ float res = max(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ max_44a39d();
+ return;
+}
+
+void fragment_main() {
+ max_44a39d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_44a39d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl
new file mode 100644
index 0000000..4dc7f9c
--- /dev/null
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_44a39d() {
+ float res = fmax(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ max_44a39d();
+ return;
+}
+
+fragment void fragment_main() {
+ max_44a39d();
+ return;
+}
+
+kernel void compute_main() {
+ max_44a39d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm
new file mode 100644
index 0000000..19bb7a4
--- /dev/null
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_44a39d "max_44a39d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %max_44a39d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 NMax %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %max_44a39d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %max_44a39d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_44a39d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl
new file mode 100644
index 0000000..d520c06
--- /dev/null
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_44a39d() {
+ var res : f32 = max(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_44a39d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_44a39d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_44a39d();
+}
diff --git a/test/intrinsics/gen/max/453e04.wgsl b/test/intrinsics/gen/max/453e04.wgsl
new file mode 100644
index 0000000..1ed4d30
--- /dev/null
+++ b/test/intrinsics/gen/max/453e04.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_453e04() {
+ var res: vec4<u32> = max(vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_453e04();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_453e04();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_453e04();
+}
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl
new file mode 100644
index 0000000..1500fa2
--- /dev/null
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_453e04() {
+ uint4 res = max(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ max_453e04();
+ return;
+}
+
+void fragment_main() {
+ max_453e04();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_453e04();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.msl b/test/intrinsics/gen/max/453e04.wgsl.expected.msl
new file mode 100644
index 0000000..9704013
--- /dev/null
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_453e04() {
+ uint4 res = max(uint4(), uint4());
+}
+
+vertex void vertex_main() {
+ max_453e04();
+ return;
+}
+
+fragment void fragment_main() {
+ max_453e04();
+ return;
+}
+
+kernel void compute_main() {
+ max_453e04();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm
new file mode 100644
index 0000000..c043630
--- /dev/null
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_453e04 "max_453e04"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %13 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+ %max_453e04 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %13
+ %9 = OpExtInst %v4uint %12 UMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_453e04
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_453e04
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_453e04
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl
new file mode 100644
index 0000000..37ad8eb
--- /dev/null
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_453e04() {
+ var res : vec4<u32> = max(vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_453e04();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_453e04();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_453e04();
+}
diff --git a/test/intrinsics/gen/max/462050.wgsl b/test/intrinsics/gen/max/462050.wgsl
new file mode 100644
index 0000000..1e694e8
--- /dev/null
+++ b/test/intrinsics/gen/max/462050.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_462050() {
+ var res: vec2<f32> = max(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_462050();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_462050();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_462050();
+}
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl
new file mode 100644
index 0000000..cab3796
--- /dev/null
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_462050() {
+ float2 res = max(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ max_462050();
+ return;
+}
+
+void fragment_main() {
+ max_462050();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_462050();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.msl b/test/intrinsics/gen/max/462050.wgsl.expected.msl
new file mode 100644
index 0000000..073d8df
--- /dev/null
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_462050() {
+ float2 res = fmax(float2(), float2());
+}
+
+vertex void vertex_main() {
+ max_462050();
+ return;
+}
+
+fragment void fragment_main() {
+ max_462050();
+ return;
+}
+
+kernel void compute_main() {
+ max_462050();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm
new file mode 100644
index 0000000..02f6779
--- /dev/null
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_462050 "max_462050"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %max_462050 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 NMax %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %max_462050
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %max_462050
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %max_462050
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl
new file mode 100644
index 0000000..07aa216
--- /dev/null
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_462050() {
+ var res : vec2<f32> = max(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_462050();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_462050();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_462050();
+}
diff --git a/test/intrinsics/gen/max/4883ac.wgsl b/test/intrinsics/gen/max/4883ac.wgsl
new file mode 100644
index 0000000..e8da7d2
--- /dev/null
+++ b/test/intrinsics/gen/max/4883ac.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_4883ac() {
+ var res: vec3<f32> = max(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_4883ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_4883ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_4883ac();
+}
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl
new file mode 100644
index 0000000..d14a43d
--- /dev/null
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_4883ac() {
+ float3 res = max(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ max_4883ac();
+ return;
+}
+
+void fragment_main() {
+ max_4883ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_4883ac();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl
new file mode 100644
index 0000000..05f7616
--- /dev/null
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_4883ac() {
+ float3 res = fmax(float3(), float3());
+}
+
+vertex void vertex_main() {
+ max_4883ac();
+ return;
+}
+
+fragment void fragment_main() {
+ max_4883ac();
+ return;
+}
+
+kernel void compute_main() {
+ max_4883ac();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm
new file mode 100644
index 0000000..9af3925
--- /dev/null
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_4883ac "max_4883ac"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %max_4883ac = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 NMax %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %max_4883ac
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %max_4883ac
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %max_4883ac
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl
new file mode 100644
index 0000000..a066ad5
--- /dev/null
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_4883ac() {
+ var res : vec3<f32> = max(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_4883ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_4883ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_4883ac();
+}
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl
new file mode 100644
index 0000000..a915f0d
--- /dev/null
+++ b/test/intrinsics/gen/max/85e6bc.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_85e6bc() {
+ var res: vec4<i32> = max(vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_85e6bc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_85e6bc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_85e6bc();
+}
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl
new file mode 100644
index 0000000..17f9ed7
--- /dev/null
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_85e6bc() {
+ int4 res = max(int4(0, 0, 0, 0), int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ max_85e6bc();
+ return;
+}
+
+void fragment_main() {
+ max_85e6bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_85e6bc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl
new file mode 100644
index 0000000..67c75e7
--- /dev/null
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_85e6bc() {
+ int4 res = max(int4(), int4());
+}
+
+vertex void vertex_main() {
+ max_85e6bc();
+ return;
+}
+
+fragment void fragment_main() {
+ max_85e6bc();
+ return;
+}
+
+kernel void compute_main() {
+ max_85e6bc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..b3dd4ca
--- /dev/null
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_85e6bc "max_85e6bc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %13 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+ %max_85e6bc = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %13
+ %9 = OpExtInst %v4int %12 SMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_85e6bc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_85e6bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_85e6bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..2055bb6
--- /dev/null
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_85e6bc() {
+ var res : vec4<i32> = max(vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_85e6bc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_85e6bc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_85e6bc();
+}
diff --git a/test/intrinsics/gen/max/a93419.wgsl b/test/intrinsics/gen/max/a93419.wgsl
new file mode 100644
index 0000000..1856337
--- /dev/null
+++ b/test/intrinsics/gen/max/a93419.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_a93419() {
+ var res: vec4<f32> = max(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_a93419();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_a93419();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_a93419();
+}
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl
new file mode 100644
index 0000000..3701fa2
--- /dev/null
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_a93419() {
+ float4 res = max(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ max_a93419();
+ return;
+}
+
+void fragment_main() {
+ max_a93419();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_a93419();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.msl b/test/intrinsics/gen/max/a93419.wgsl.expected.msl
new file mode 100644
index 0000000..abe3fc6
--- /dev/null
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_a93419() {
+ float4 res = fmax(float4(), float4());
+}
+
+vertex void vertex_main() {
+ max_a93419();
+ return;
+}
+
+fragment void fragment_main() {
+ max_a93419();
+ return;
+}
+
+kernel void compute_main() {
+ max_a93419();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm
new file mode 100644
index 0000000..c65a59f
--- /dev/null
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_a93419 "max_a93419"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %max_a93419 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 NMax %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %max_a93419
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %max_a93419
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %max_a93419
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl
new file mode 100644
index 0000000..a278e21
--- /dev/null
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_a93419() {
+ var res : vec4<f32> = max(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_a93419();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_a93419();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_a93419();
+}
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl
new file mode 100644
index 0000000..2cbe7db
--- /dev/null
+++ b/test/intrinsics/gen/max/b1b73a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_b1b73a() {
+ var res: vec3<u32> = max(vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_b1b73a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_b1b73a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_b1b73a();
+}
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl
new file mode 100644
index 0000000..7dca442
--- /dev/null
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_b1b73a() {
+ uint3 res = max(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ max_b1b73a();
+ return;
+}
+
+void fragment_main() {
+ max_b1b73a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_b1b73a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl
new file mode 100644
index 0000000..979f9d5
--- /dev/null
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_b1b73a() {
+ uint3 res = max(uint3(), uint3());
+}
+
+vertex void vertex_main() {
+ max_b1b73a();
+ return;
+}
+
+fragment void fragment_main() {
+ max_b1b73a();
+ return;
+}
+
+kernel void compute_main() {
+ max_b1b73a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm
new file mode 100644
index 0000000..4296bae
--- /dev/null
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_b1b73a "max_b1b73a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %13 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+ %max_b1b73a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %13
+ %9 = OpExtInst %v3uint %12 UMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_b1b73a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_b1b73a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_b1b73a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff4689f
--- /dev/null
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_b1b73a() {
+ var res : vec3<u32> = max(vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_b1b73a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_b1b73a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_b1b73a();
+}
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl
new file mode 100644
index 0000000..6f44a08
--- /dev/null
+++ b/test/intrinsics/gen/max/ce7c30.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_ce7c30() {
+ var res: i32 = max(1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_ce7c30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_ce7c30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_ce7c30();
+}
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl
new file mode 100644
index 0000000..581614a
--- /dev/null
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_ce7c30() {
+ int res = max(1, 1);
+}
+
+void vertex_main() {
+ max_ce7c30();
+ return;
+}
+
+void fragment_main() {
+ max_ce7c30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_ce7c30();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl
new file mode 100644
index 0000000..125162c
--- /dev/null
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_ce7c30() {
+ int res = max(1, 1);
+}
+
+vertex void vertex_main() {
+ max_ce7c30();
+ return;
+}
+
+fragment void fragment_main() {
+ max_ce7c30();
+ return;
+}
+
+kernel void compute_main() {
+ max_ce7c30();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm
new file mode 100644
index 0000000..83b18b4
--- /dev/null
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_ce7c30 "max_ce7c30"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %15 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %max_ce7c30 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %15
+ %9 = OpExtInst %int %11 SMax %int_1 %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_ce7c30
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_ce7c30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_ce7c30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl
new file mode 100644
index 0000000..c682b34
--- /dev/null
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_ce7c30() {
+ var res : i32 = max(1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_ce7c30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_ce7c30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_ce7c30();
+}
diff --git a/test/intrinsics/gen/max/e8192f.wgsl b/test/intrinsics/gen/max/e8192f.wgsl
new file mode 100644
index 0000000..2609dcb
--- /dev/null
+++ b/test/intrinsics/gen/max/e8192f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn max_e8192f() {
+ var res: vec2<i32> = max(vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_e8192f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_e8192f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_e8192f();
+}
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl
new file mode 100644
index 0000000..cda8e83
--- /dev/null
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void max_e8192f() {
+ int2 res = max(int2(0, 0), int2(0, 0));
+}
+
+void vertex_main() {
+ max_e8192f();
+ return;
+}
+
+void fragment_main() {
+ max_e8192f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ max_e8192f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl
new file mode 100644
index 0000000..c6165c3
--- /dev/null
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void max_e8192f() {
+ int2 res = max(int2(), int2());
+}
+
+vertex void vertex_main() {
+ max_e8192f();
+ return;
+}
+
+fragment void fragment_main() {
+ max_e8192f();
+ return;
+}
+
+kernel void compute_main() {
+ max_e8192f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm
new file mode 100644
index 0000000..676cac1
--- /dev/null
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %max_e8192f "max_e8192f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %13 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+ %max_e8192f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %13
+ %9 = OpExtInst %v2int %12 SMax %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %max_e8192f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %max_e8192f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %max_e8192f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl
new file mode 100644
index 0000000..b5720fb
--- /dev/null
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn max_e8192f() {
+ var res : vec2<i32> = max(vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ max_e8192f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ max_e8192f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ max_e8192f();
+}
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl
new file mode 100644
index 0000000..9b0727f
--- /dev/null
+++ b/test/intrinsics/gen/min/03c7e3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_03c7e3() {
+ var res: vec2<i32> = min(vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_03c7e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_03c7e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_03c7e3();
+}
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl
new file mode 100644
index 0000000..c4e4bbb
--- /dev/null
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_03c7e3() {
+ int2 res = min(int2(0, 0), int2(0, 0));
+}
+
+void vertex_main() {
+ min_03c7e3();
+ return;
+}
+
+void fragment_main() {
+ min_03c7e3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_03c7e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl
new file mode 100644
index 0000000..ba68209
--- /dev/null
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_03c7e3() {
+ int2 res = min(int2(), int2());
+}
+
+vertex void vertex_main() {
+ min_03c7e3();
+ return;
+}
+
+fragment void fragment_main() {
+ min_03c7e3();
+ return;
+}
+
+kernel void compute_main() {
+ min_03c7e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2d7d52
--- /dev/null
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_03c7e3 "min_03c7e3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %13 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+ %min_03c7e3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %13
+ %9 = OpExtInst %v2int %12 SMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_03c7e3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_03c7e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_03c7e3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl
new file mode 100644
index 0000000..2098c20
--- /dev/null
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_03c7e3() {
+ var res : vec2<i32> = min(vec2<i32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_03c7e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_03c7e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_03c7e3();
+}
diff --git a/test/intrinsics/gen/min/0dc614.wgsl b/test/intrinsics/gen/min/0dc614.wgsl
new file mode 100644
index 0000000..7f33995
--- /dev/null
+++ b/test/intrinsics/gen/min/0dc614.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_0dc614() {
+ var res: vec4<u32> = min(vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_0dc614();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_0dc614();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_0dc614();
+}
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl
new file mode 100644
index 0000000..2916bb5
--- /dev/null
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_0dc614() {
+ uint4 res = min(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ min_0dc614();
+ return;
+}
+
+void fragment_main() {
+ min_0dc614();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_0dc614();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl
new file mode 100644
index 0000000..0baef43
--- /dev/null
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_0dc614() {
+ uint4 res = min(uint4(), uint4());
+}
+
+vertex void vertex_main() {
+ min_0dc614();
+ return;
+}
+
+fragment void fragment_main() {
+ min_0dc614();
+ return;
+}
+
+kernel void compute_main() {
+ min_0dc614();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm
new file mode 100644
index 0000000..52ba04e
--- /dev/null
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_0dc614 "min_0dc614"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %13 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+ %min_0dc614 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %13
+ %9 = OpExtInst %v4uint %12 UMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_0dc614
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_0dc614
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_0dc614
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl
new file mode 100644
index 0000000..5c1965c
--- /dev/null
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_0dc614() {
+ var res : vec4<u32> = min(vec4<u32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_0dc614();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_0dc614();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_0dc614();
+}
diff --git a/test/intrinsics/gen/min/3941e1.wgsl b/test/intrinsics/gen/min/3941e1.wgsl
new file mode 100644
index 0000000..4e74104
--- /dev/null
+++ b/test/intrinsics/gen/min/3941e1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_3941e1() {
+ var res: vec4<i32> = min(vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_3941e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_3941e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_3941e1();
+}
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl
new file mode 100644
index 0000000..f21aacf
--- /dev/null
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_3941e1() {
+ int4 res = min(int4(0, 0, 0, 0), int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ min_3941e1();
+ return;
+}
+
+void fragment_main() {
+ min_3941e1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_3941e1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl
new file mode 100644
index 0000000..25c94c3
--- /dev/null
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_3941e1() {
+ int4 res = min(int4(), int4());
+}
+
+vertex void vertex_main() {
+ min_3941e1();
+ return;
+}
+
+fragment void fragment_main() {
+ min_3941e1();
+ return;
+}
+
+kernel void compute_main() {
+ min_3941e1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1b3f0f3
--- /dev/null
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_3941e1 "min_3941e1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %13 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+ %min_3941e1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %13
+ %9 = OpExtInst %v4int %12 SMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_3941e1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_3941e1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_3941e1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl
new file mode 100644
index 0000000..cd5ed89
--- /dev/null
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_3941e1() {
+ var res : vec4<i32> = min(vec4<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_3941e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_3941e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_3941e1();
+}
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl
new file mode 100644
index 0000000..b1603fb
--- /dev/null
+++ b/test/intrinsics/gen/min/46c5d3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_46c5d3() {
+ var res: u32 = min(1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_46c5d3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_46c5d3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_46c5d3();
+}
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl
new file mode 100644
index 0000000..fda2c28
--- /dev/null
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_46c5d3() {
+ uint res = min(1u, 1u);
+}
+
+void vertex_main() {
+ min_46c5d3();
+ return;
+}
+
+void fragment_main() {
+ min_46c5d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_46c5d3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl
new file mode 100644
index 0000000..9d2021e
--- /dev/null
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_46c5d3() {
+ uint res = min(1u, 1u);
+}
+
+vertex void vertex_main() {
+ min_46c5d3();
+ return;
+}
+
+fragment void fragment_main() {
+ min_46c5d3();
+ return;
+}
+
+kernel void compute_main() {
+ min_46c5d3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm
new file mode 100644
index 0000000..093c7c8
--- /dev/null
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_46c5d3 "min_46c5d3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %15 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %min_46c5d3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %15
+ %9 = OpExtInst %uint %11 UMin %uint_1 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_46c5d3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_46c5d3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_46c5d3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl
new file mode 100644
index 0000000..4792db1
--- /dev/null
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_46c5d3() {
+ var res : u32 = min(1u, 1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_46c5d3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_46c5d3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_46c5d3();
+}
diff --git a/test/intrinsics/gen/min/82b28f.wgsl b/test/intrinsics/gen/min/82b28f.wgsl
new file mode 100644
index 0000000..3dc216d
--- /dev/null
+++ b/test/intrinsics/gen/min/82b28f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_82b28f() {
+ var res: vec2<u32> = min(vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_82b28f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_82b28f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_82b28f();
+}
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl
new file mode 100644
index 0000000..96cdb72
--- /dev/null
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_82b28f() {
+ uint2 res = min(uint2(0u, 0u), uint2(0u, 0u));
+}
+
+void vertex_main() {
+ min_82b28f();
+ return;
+}
+
+void fragment_main() {
+ min_82b28f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_82b28f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl
new file mode 100644
index 0000000..c79d466
--- /dev/null
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_82b28f() {
+ uint2 res = min(uint2(), uint2());
+}
+
+vertex void vertex_main() {
+ min_82b28f();
+ return;
+}
+
+fragment void fragment_main() {
+ min_82b28f();
+ return;
+}
+
+kernel void compute_main() {
+ min_82b28f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm
new file mode 100644
index 0000000..869b476
--- /dev/null
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_82b28f "min_82b28f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %13 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+ %min_82b28f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %13
+ %9 = OpExtInst %v2uint %12 UMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_82b28f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_82b28f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_82b28f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl
new file mode 100644
index 0000000..cd3d2a7
--- /dev/null
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_82b28f() {
+ var res : vec2<u32> = min(vec2<u32>(), vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_82b28f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_82b28f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_82b28f();
+}
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl
new file mode 100644
index 0000000..af0896c
--- /dev/null
+++ b/test/intrinsics/gen/min/93cfc4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_93cfc4() {
+ var res: vec3<f32> = min(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_93cfc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_93cfc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_93cfc4();
+}
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl
new file mode 100644
index 0000000..c3d2e41
--- /dev/null
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_93cfc4() {
+ float3 res = min(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ min_93cfc4();
+ return;
+}
+
+void fragment_main() {
+ min_93cfc4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_93cfc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl
new file mode 100644
index 0000000..2333a21
--- /dev/null
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_93cfc4() {
+ float3 res = fmin(float3(), float3());
+}
+
+vertex void vertex_main() {
+ min_93cfc4();
+ return;
+}
+
+fragment void fragment_main() {
+ min_93cfc4();
+ return;
+}
+
+kernel void compute_main() {
+ min_93cfc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm
new file mode 100644
index 0000000..c4c3db9
--- /dev/null
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_93cfc4 "min_93cfc4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %min_93cfc4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 NMin %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %min_93cfc4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %min_93cfc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %min_93cfc4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl
new file mode 100644
index 0000000..a285e0d
--- /dev/null
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_93cfc4() {
+ var res : vec3<f32> = min(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_93cfc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_93cfc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_93cfc4();
+}
diff --git a/test/intrinsics/gen/min/a45171.wgsl b/test/intrinsics/gen/min/a45171.wgsl
new file mode 100644
index 0000000..5c70dba
--- /dev/null
+++ b/test/intrinsics/gen/min/a45171.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_a45171() {
+ var res: vec3<i32> = min(vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_a45171();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_a45171();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_a45171();
+}
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl
new file mode 100644
index 0000000..7c4503e
--- /dev/null
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_a45171() {
+ int3 res = min(int3(0, 0, 0), int3(0, 0, 0));
+}
+
+void vertex_main() {
+ min_a45171();
+ return;
+}
+
+void fragment_main() {
+ min_a45171();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_a45171();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.msl b/test/intrinsics/gen/min/a45171.wgsl.expected.msl
new file mode 100644
index 0000000..9b4cdd6
--- /dev/null
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_a45171() {
+ int3 res = min(int3(), int3());
+}
+
+vertex void vertex_main() {
+ min_a45171();
+ return;
+}
+
+fragment void fragment_main() {
+ min_a45171();
+ return;
+}
+
+kernel void compute_main() {
+ min_a45171();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm
new file mode 100644
index 0000000..9b0d611
--- /dev/null
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_a45171 "min_a45171"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %13 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+ %min_a45171 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %13
+ %9 = OpExtInst %v3int %12 SMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_a45171
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_a45171
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_a45171
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl
new file mode 100644
index 0000000..4d10949
--- /dev/null
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_a45171() {
+ var res : vec3<i32> = min(vec3<i32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_a45171();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_a45171();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_a45171();
+}
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl
new file mode 100644
index 0000000..78ab786
--- /dev/null
+++ b/test/intrinsics/gen/min/aa28ad.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_aa28ad() {
+ var res: vec2<f32> = min(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_aa28ad();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_aa28ad();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_aa28ad();
+}
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl
new file mode 100644
index 0000000..adffe08
--- /dev/null
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_aa28ad() {
+ float2 res = min(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ min_aa28ad();
+ return;
+}
+
+void fragment_main() {
+ min_aa28ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_aa28ad();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl
new file mode 100644
index 0000000..e3235d3
--- /dev/null
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_aa28ad() {
+ float2 res = fmin(float2(), float2());
+}
+
+vertex void vertex_main() {
+ min_aa28ad();
+ return;
+}
+
+fragment void fragment_main() {
+ min_aa28ad();
+ return;
+}
+
+kernel void compute_main() {
+ min_aa28ad();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..e37dabc
--- /dev/null
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_aa28ad "min_aa28ad"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %min_aa28ad = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 NMin %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %min_aa28ad
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %min_aa28ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %min_aa28ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..ea0d321
--- /dev/null
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_aa28ad() {
+ var res : vec2<f32> = min(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_aa28ad();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_aa28ad();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_aa28ad();
+}
diff --git a/test/intrinsics/gen/min/af326d.wgsl b/test/intrinsics/gen/min/af326d.wgsl
new file mode 100644
index 0000000..421360a
--- /dev/null
+++ b/test/intrinsics/gen/min/af326d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_af326d() {
+ var res: f32 = min(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_af326d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_af326d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_af326d();
+}
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl
new file mode 100644
index 0000000..fd8e65a
--- /dev/null
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_af326d() {
+ float res = min(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ min_af326d();
+ return;
+}
+
+void fragment_main() {
+ min_af326d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_af326d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.msl b/test/intrinsics/gen/min/af326d.wgsl.expected.msl
new file mode 100644
index 0000000..9e219a3
--- /dev/null
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_af326d() {
+ float res = fmin(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ min_af326d();
+ return;
+}
+
+fragment void fragment_main() {
+ min_af326d();
+ return;
+}
+
+kernel void compute_main() {
+ min_af326d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm
new file mode 100644
index 0000000..a7c01c3
--- /dev/null
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_af326d "min_af326d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %min_af326d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 NMin %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %min_af326d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %min_af326d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_af326d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl
new file mode 100644
index 0000000..6e1515d
--- /dev/null
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_af326d() {
+ var res : f32 = min(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_af326d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_af326d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_af326d();
+}
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl
new file mode 100644
index 0000000..6daef6c
--- /dev/null
+++ b/test/intrinsics/gen/min/c70bb7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_c70bb7() {
+ var res: vec3<u32> = min(vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c70bb7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c70bb7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c70bb7();
+}
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl
new file mode 100644
index 0000000..0d4d6a6
--- /dev/null
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_c70bb7() {
+ uint3 res = min(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ min_c70bb7();
+ return;
+}
+
+void fragment_main() {
+ min_c70bb7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_c70bb7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl
new file mode 100644
index 0000000..d49a6bc
--- /dev/null
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_c70bb7() {
+ uint3 res = min(uint3(), uint3());
+}
+
+vertex void vertex_main() {
+ min_c70bb7();
+ return;
+}
+
+fragment void fragment_main() {
+ min_c70bb7();
+ return;
+}
+
+kernel void compute_main() {
+ min_c70bb7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5b03ab
--- /dev/null
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_c70bb7 "min_c70bb7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %13 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+ %min_c70bb7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %13
+ %9 = OpExtInst %v3uint %12 UMin %13 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_c70bb7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_c70bb7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_c70bb7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl
new file mode 100644
index 0000000..3d86d95
--- /dev/null
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_c70bb7() {
+ var res : vec3<u32> = min(vec3<u32>(), vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c70bb7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c70bb7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c70bb7();
+}
diff --git a/test/intrinsics/gen/min/c73147.wgsl b/test/intrinsics/gen/min/c73147.wgsl
new file mode 100644
index 0000000..09dd3c4
--- /dev/null
+++ b/test/intrinsics/gen/min/c73147.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_c73147() {
+ var res: i32 = min(1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c73147();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c73147();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c73147();
+}
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl
new file mode 100644
index 0000000..3f6819a
--- /dev/null
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_c73147() {
+ int res = min(1, 1);
+}
+
+void vertex_main() {
+ min_c73147();
+ return;
+}
+
+void fragment_main() {
+ min_c73147();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_c73147();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.msl b/test/intrinsics/gen/min/c73147.wgsl.expected.msl
new file mode 100644
index 0000000..9ee44ee
--- /dev/null
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_c73147() {
+ int res = min(1, 1);
+}
+
+vertex void vertex_main() {
+ min_c73147();
+ return;
+}
+
+fragment void fragment_main() {
+ min_c73147();
+ return;
+}
+
+kernel void compute_main() {
+ min_c73147();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm
new file mode 100644
index 0000000..687c902
--- /dev/null
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm
@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_c73147 "min_c73147"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %15 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %min_c73147 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %15
+ %9 = OpExtInst %int %11 SMin %int_1 %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %19 = OpFunctionCall %void %min_c73147
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %min_c73147
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %min_c73147
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl
new file mode 100644
index 0000000..59a2cfc
--- /dev/null
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_c73147() {
+ var res : i32 = min(1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c73147();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c73147();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c73147();
+}
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl
new file mode 100644
index 0000000..86b14be
--- /dev/null
+++ b/test/intrinsics/gen/min/c76fa6.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn min_c76fa6() {
+ var res: vec4<f32> = min(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c76fa6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c76fa6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c76fa6();
+}
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl
new file mode 100644
index 0000000..55d25a7
--- /dev/null
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void min_c76fa6() {
+ float4 res = min(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ min_c76fa6();
+ return;
+}
+
+void fragment_main() {
+ min_c76fa6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ min_c76fa6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl
new file mode 100644
index 0000000..85a723e
--- /dev/null
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void min_c76fa6() {
+ float4 res = fmin(float4(), float4());
+}
+
+vertex void vertex_main() {
+ min_c76fa6();
+ return;
+}
+
+fragment void fragment_main() {
+ min_c76fa6();
+ return;
+}
+
+kernel void compute_main() {
+ min_c76fa6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8e63d7
--- /dev/null
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %min_c76fa6 "min_c76fa6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %min_c76fa6 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 NMin %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %min_c76fa6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %min_c76fa6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %min_c76fa6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl
new file mode 100644
index 0000000..b9c81fd
--- /dev/null
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn min_c76fa6() {
+ var res : vec4<f32> = min(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ min_c76fa6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ min_c76fa6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ min_c76fa6();
+}
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl
new file mode 100644
index 0000000..497f81a
--- /dev/null
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn mix_0c8c33() {
+ var res: vec3<f32> = mix(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_0c8c33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_0c8c33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_0c8c33();
+}
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl
new file mode 100644
index 0000000..b520655
--- /dev/null
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void mix_0c8c33() {
+ float3 res = lerp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ mix_0c8c33();
+ return;
+}
+
+void fragment_main() {
+ mix_0c8c33();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ mix_0c8c33();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl
new file mode 100644
index 0000000..a9ba57e
--- /dev/null
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void mix_0c8c33() {
+ float3 res = mix(float3(), float3(), float3());
+}
+
+vertex void vertex_main() {
+ mix_0c8c33();
+ return;
+}
+
+fragment void fragment_main() {
+ mix_0c8c33();
+ return;
+}
+
+kernel void compute_main() {
+ mix_0c8c33();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm
new file mode 100644
index 0000000..7ebdd25
--- /dev/null
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %mix_0c8c33 "mix_0c8c33"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %mix_0c8c33 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 FMix %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %mix_0c8c33
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %mix_0c8c33
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %mix_0c8c33
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl
new file mode 100644
index 0000000..cbcde05
--- /dev/null
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn mix_0c8c33() {
+ var res : vec3<f32> = mix(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_0c8c33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_0c8c33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_0c8c33();
+}
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl
new file mode 100644
index 0000000..ff54cd2
--- /dev/null
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn mix_4f0b5e() {
+ var res: f32 = mix(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_4f0b5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_4f0b5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_4f0b5e();
+}
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl
new file mode 100644
index 0000000..0e0d6cf
--- /dev/null
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void mix_4f0b5e() {
+ float res = lerp(1.0f, 1.0f, 1.0f);
+}
+
+void vertex_main() {
+ mix_4f0b5e();
+ return;
+}
+
+void fragment_main() {
+ mix_4f0b5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ mix_4f0b5e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl
new file mode 100644
index 0000000..2ed9515
--- /dev/null
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void mix_4f0b5e() {
+ float res = mix(1.0f, 1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ mix_4f0b5e();
+ return;
+}
+
+fragment void fragment_main() {
+ mix_4f0b5e();
+ return;
+}
+
+kernel void compute_main() {
+ mix_4f0b5e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..a35bde5
--- /dev/null
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %mix_4f0b5e "mix_4f0b5e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %mix_4f0b5e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 FMix %float_1 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %mix_4f0b5e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %mix_4f0b5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %mix_4f0b5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..847669d
--- /dev/null
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn mix_4f0b5e() {
+ var res : f32 = mix(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_4f0b5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_4f0b5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_4f0b5e();
+}
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl
new file mode 100644
index 0000000..b38477c
--- /dev/null
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn mix_6f8adc() {
+ var res: vec2<f32> = mix(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_6f8adc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_6f8adc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_6f8adc();
+}
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl
new file mode 100644
index 0000000..dd8fa59
--- /dev/null
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void mix_6f8adc() {
+ float2 res = lerp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ mix_6f8adc();
+ return;
+}
+
+void fragment_main() {
+ mix_6f8adc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ mix_6f8adc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl
new file mode 100644
index 0000000..6e65e03
--- /dev/null
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void mix_6f8adc() {
+ float2 res = mix(float2(), float2(), float2());
+}
+
+vertex void vertex_main() {
+ mix_6f8adc();
+ return;
+}
+
+fragment void fragment_main() {
+ mix_6f8adc();
+ return;
+}
+
+kernel void compute_main() {
+ mix_6f8adc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea47804
--- /dev/null
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %mix_6f8adc "mix_6f8adc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %mix_6f8adc = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 FMix %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %mix_6f8adc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %mix_6f8adc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %mix_6f8adc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl
new file mode 100644
index 0000000..7a2ae66
--- /dev/null
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn mix_6f8adc() {
+ var res : vec2<f32> = mix(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_6f8adc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_6f8adc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_6f8adc();
+}
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl
new file mode 100644
index 0000000..083fa4d
--- /dev/null
+++ b/test/intrinsics/gen/mix/c37ede.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn mix_c37ede() {
+ var res: vec4<f32> = mix(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_c37ede();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_c37ede();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_c37ede();
+}
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl
new file mode 100644
index 0000000..e66be23
--- /dev/null
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void mix_c37ede() {
+ float4 res = lerp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ mix_c37ede();
+ return;
+}
+
+void fragment_main() {
+ mix_c37ede();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ mix_c37ede();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl
new file mode 100644
index 0000000..2da352e
--- /dev/null
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void mix_c37ede() {
+ float4 res = mix(float4(), float4(), float4());
+}
+
+vertex void vertex_main() {
+ mix_c37ede();
+ return;
+}
+
+fragment void fragment_main() {
+ mix_c37ede();
+ return;
+}
+
+kernel void compute_main() {
+ mix_c37ede();
+ return;
+}
+
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm
new file mode 100644
index 0000000..4277d14
--- /dev/null
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %mix_c37ede "mix_c37ede"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %mix_c37ede = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 FMix %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %mix_c37ede
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %mix_c37ede
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %mix_c37ede
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl
new file mode 100644
index 0000000..72a921b
--- /dev/null
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn mix_c37ede() {
+ var res : vec4<f32> = mix(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ mix_c37ede();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ mix_c37ede();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ mix_c37ede();
+}
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl
new file mode 100644
index 0000000..fbc453d
--- /dev/null
+++ b/test/intrinsics/gen/modf/8d6261.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn modf_8d6261() {
+ var arg_1: f32;
+ var res: f32 = modf(1.0, &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_8d6261();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_8d6261();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_8d6261();
+}
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl
new file mode 100644
index 0000000..ccd4c1e
--- /dev/null
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_8d6261() {
+ var arg_1 : f32;
+ var res : f32 = modf(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_8d6261();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_8d6261();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_8d6261();
+}
+
+Failed to generate: error: Unknown builtin method: modf
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl
new file mode 100644
index 0000000..8db3689
--- /dev/null
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_8d6261() {
+ var arg_1 : f32;
+ var res : f32 = modf(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_8d6261();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_8d6261();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_8d6261();
+}
+
+Failed to generate: error: Unknown import method: modf
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm
new file mode 100644
index 0000000..ca34c91
--- /dev/null
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %12 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %modf_8d6261 "modf_8d6261"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%modf_8d6261 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_float Function %4
+ %res = OpVariable %_ptr_Function_float Function %4
+ %11 = OpExtInst %float %12 Modf %float_1 %arg_1
+ OpStore %res %11
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %17 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %modf_8d6261
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %modf_8d6261
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %modf_8d6261
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl
new file mode 100644
index 0000000..2afc9f9
--- /dev/null
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn modf_8d6261() {
+ var arg_1 : f32;
+ var res : f32 = modf(1.0, &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_8d6261();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_8d6261();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_8d6261();
+}
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl
new file mode 100644
index 0000000..c8fa7a7
--- /dev/null
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn modf_c82e3f() {
+ var arg_1: vec4<f32>;
+ var res: vec4<f32> = modf(vec4<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_c82e3f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_c82e3f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_c82e3f();
+}
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl
new file mode 100644
index 0000000..f1508a0
--- /dev/null
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_c82e3f() {
+ var arg_1 : vec4<f32>;
+ var res : vec4<f32> = modf(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_c82e3f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_c82e3f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_c82e3f();
+}
+
+Failed to generate: error: Unknown builtin method: modf
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl
new file mode 100644
index 0000000..a6f21e05
--- /dev/null
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_c82e3f() {
+ var arg_1 : vec4<f32>;
+ var res : vec4<f32> = modf(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_c82e3f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_c82e3f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_c82e3f();
+}
+
+Failed to generate: error: Unknown import method: modf
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm
new file mode 100644
index 0000000..e32d405
--- /dev/null
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %modf_c82e3f "modf_c82e3f"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %12 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%modf_c82e3f = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4float Function %12
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %13 = OpExtInst %v4float %14 Modf %12 %arg_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %modf_c82e3f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %modf_c82e3f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %modf_c82e3f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl
new file mode 100644
index 0000000..17caaf0
--- /dev/null
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn modf_c82e3f() {
+ var arg_1 : vec4<f32>;
+ var res : vec4<f32> = modf(vec4<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_c82e3f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_c82e3f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_c82e3f();
+}
diff --git a/test/intrinsics/gen/modf/d62477.wgsl b/test/intrinsics/gen/modf/d62477.wgsl
new file mode 100644
index 0000000..a96fefe
--- /dev/null
+++ b/test/intrinsics/gen/modf/d62477.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn modf_d62477() {
+ var arg_1: vec2<f32>;
+ var res: vec2<f32> = modf(vec2<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_d62477();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_d62477();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_d62477();
+}
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl
new file mode 100644
index 0000000..a70bf73
--- /dev/null
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_d62477() {
+ var arg_1 : vec2<f32>;
+ var res : vec2<f32> = modf(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_d62477();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_d62477();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_d62477();
+}
+
+Failed to generate: error: Unknown builtin method: modf
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.msl b/test/intrinsics/gen/modf/d62477.wgsl.expected.msl
new file mode 100644
index 0000000..5d2cb3f
--- /dev/null
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_d62477() {
+ var arg_1 : vec2<f32>;
+ var res : vec2<f32> = modf(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_d62477();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_d62477();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_d62477();
+}
+
+Failed to generate: error: Unknown import method: modf
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm
new file mode 100644
index 0000000..6f536e1
--- /dev/null
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %modf_d62477 "modf_d62477"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %12 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%modf_d62477 = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2float Function %12
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %13 = OpExtInst %v2float %14 Modf %12 %arg_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %modf_d62477
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %modf_d62477
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %modf_d62477
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl
new file mode 100644
index 0000000..0dd0dff
--- /dev/null
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn modf_d62477() {
+ var arg_1 : vec2<f32>;
+ var res : vec2<f32> = modf(vec2<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_d62477();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_d62477();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_d62477();
+}
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl
new file mode 100644
index 0000000..2127285
--- /dev/null
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn modf_f9f98c() {
+ var arg_1: vec3<f32>;
+ var res: vec3<f32> = modf(vec3<f32>(), &arg_1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_f9f98c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_f9f98c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_f9f98c();
+}
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl
new file mode 100644
index 0000000..c55eb0c
--- /dev/null
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_f9f98c() {
+ var arg_1 : vec3<f32>;
+ var res : vec3<f32> = modf(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_f9f98c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_f9f98c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_f9f98c();
+}
+
+Failed to generate: error: Unknown builtin method: modf
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl
new file mode 100644
index 0000000..6ad9f9e
--- /dev/null
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl
@@ -0,0 +1,24 @@
+SKIP: FAILED
+
+
+fn modf_f9f98c() {
+ var arg_1 : vec3<f32>;
+ var res : vec3<f32> = modf(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_f9f98c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_f9f98c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_f9f98c();
+}
+
+Failed to generate: error: Unknown import method: modf
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm
new file mode 100644
index 0000000..44dfbf8
--- /dev/null
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %14 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %modf_f9f98c "modf_f9f98c"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %12 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+%modf_f9f98c = OpFunction %void None %5
+ %8 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3float Function %12
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %13 = OpExtInst %v3float %14 Modf %12 %arg_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %modf_f9f98c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %modf_f9f98c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %modf_f9f98c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl
new file mode 100644
index 0000000..31d6412
--- /dev/null
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn modf_f9f98c() {
+ var arg_1 : vec3<f32>;
+ var res : vec3<f32> = modf(vec3<f32>(), &(arg_1));
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ modf_f9f98c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ modf_f9f98c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ modf_f9f98c();
+}
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl
new file mode 100644
index 0000000..5cc7274
--- /dev/null
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn normalize_64d8c0() {
+ var res: vec3<f32> = normalize(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_64d8c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_64d8c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_64d8c0();
+}
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl
new file mode 100644
index 0000000..c3c93d9
--- /dev/null
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void normalize_64d8c0() {
+ float3 res = normalize(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ normalize_64d8c0();
+ return;
+}
+
+void fragment_main() {
+ normalize_64d8c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ normalize_64d8c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl
new file mode 100644
index 0000000..63a1895
--- /dev/null
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void normalize_64d8c0() {
+ float3 res = normalize(float3());
+}
+
+vertex void vertex_main() {
+ normalize_64d8c0();
+ return;
+}
+
+fragment void fragment_main() {
+ normalize_64d8c0();
+ return;
+}
+
+kernel void compute_main() {
+ normalize_64d8c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..c3c10f9
--- /dev/null
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %normalize_64d8c0 "normalize_64d8c0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%normalize_64d8c0 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Normalize %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %normalize_64d8c0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %normalize_64d8c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %normalize_64d8c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..3949845
--- /dev/null
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn normalize_64d8c0() {
+ var res : vec3<f32> = normalize(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_64d8c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_64d8c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_64d8c0();
+}
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl
new file mode 100644
index 0000000..2640499
--- /dev/null
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn normalize_9a0aab() {
+ var res: vec4<f32> = normalize(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_9a0aab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_9a0aab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_9a0aab();
+}
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl
new file mode 100644
index 0000000..064c758
--- /dev/null
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void normalize_9a0aab() {
+ float4 res = normalize(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ normalize_9a0aab();
+ return;
+}
+
+void fragment_main() {
+ normalize_9a0aab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ normalize_9a0aab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl
new file mode 100644
index 0000000..84dc468
--- /dev/null
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void normalize_9a0aab() {
+ float4 res = normalize(float4());
+}
+
+vertex void vertex_main() {
+ normalize_9a0aab();
+ return;
+}
+
+fragment void fragment_main() {
+ normalize_9a0aab();
+ return;
+}
+
+kernel void compute_main() {
+ normalize_9a0aab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm
new file mode 100644
index 0000000..a261175
--- /dev/null
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %normalize_9a0aab "normalize_9a0aab"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%normalize_9a0aab = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Normalize %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %normalize_9a0aab
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %normalize_9a0aab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %normalize_9a0aab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl
new file mode 100644
index 0000000..979531f
--- /dev/null
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn normalize_9a0aab() {
+ var res : vec4<f32> = normalize(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_9a0aab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_9a0aab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_9a0aab();
+}
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl
new file mode 100644
index 0000000..498bd96
--- /dev/null
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn normalize_fc2ef1() {
+ var res: vec2<f32> = normalize(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_fc2ef1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_fc2ef1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_fc2ef1();
+}
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl
new file mode 100644
index 0000000..aba2121
--- /dev/null
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void normalize_fc2ef1() {
+ float2 res = normalize(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ normalize_fc2ef1();
+ return;
+}
+
+void fragment_main() {
+ normalize_fc2ef1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ normalize_fc2ef1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl
new file mode 100644
index 0000000..6fb8128
--- /dev/null
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void normalize_fc2ef1() {
+ float2 res = normalize(float2());
+}
+
+vertex void vertex_main() {
+ normalize_fc2ef1();
+ return;
+}
+
+fragment void fragment_main() {
+ normalize_fc2ef1();
+ return;
+}
+
+kernel void compute_main() {
+ normalize_fc2ef1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm
new file mode 100644
index 0000000..99cc6bd
--- /dev/null
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %normalize_fc2ef1 "normalize_fc2ef1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%normalize_fc2ef1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Normalize %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %normalize_fc2ef1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %normalize_fc2ef1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %normalize_fc2ef1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl
new file mode 100644
index 0000000..8c35391
--- /dev/null
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn normalize_fc2ef1() {
+ var res : vec2<f32> = normalize(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ normalize_fc2ef1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ normalize_fc2ef1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ normalize_fc2ef1();
+}
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl
new file mode 100644
index 0000000..8765662
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pack2x16float_0e97b3() {
+ var res: u32 = pack2x16float(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16float_0e97b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16float_0e97b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16float_0e97b3();
+}
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl
new file mode 100644
index 0000000..c942222
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void pack2x16float_0e97b3() {
+ uint2 tint_tmp = f32tof16(float2(0.0f, 0.0f));
+uint res = (tint_tmp.x | tint_tmp.y << 16);
+}
+
+void vertex_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
+void fragment_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl
new file mode 100644
index 0000000..04b790d
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pack2x16float_0e97b3() {
+ uint res = as_type<uint>(half2(float2()));
+}
+
+vertex void vertex_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
+fragment void fragment_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
+kernel void compute_main() {
+ pack2x16float_0e97b3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..c8eac8b
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%pack2x16float_0e97b3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpExtInst %uint %11 PackHalf2x16 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %pack2x16float_0e97b3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %pack2x16float_0e97b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %pack2x16float_0e97b3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..d4d2b13
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pack2x16float_0e97b3() {
+ var res : u32 = pack2x16float(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16float_0e97b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16float_0e97b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16float_0e97b3();
+}
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl
new file mode 100644
index 0000000..1ce08a3
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pack2x16snorm_6c169b() {
+ var res: u32 = pack2x16snorm(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16snorm_6c169b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16snorm_6c169b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16snorm_6c169b();
+}
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl
new file mode 100644
index 0000000..f8db4b3
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void pack2x16snorm_6c169b() {
+ int2 tint_tmp = int2(round(clamp(float2(0.0f, 0.0f), -1.0, 1.0) * 32767.0)) & 0xffff;
+uint res = asuint(tint_tmp.x | tint_tmp.y << 16);
+}
+
+void vertex_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
+void fragment_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl
new file mode 100644
index 0000000..744c4b4
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pack2x16snorm_6c169b() {
+ uint res = pack_float_to_snorm2x16(float2());
+}
+
+vertex void vertex_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
+fragment void fragment_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
+kernel void compute_main() {
+ pack2x16snorm_6c169b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm
new file mode 100644
index 0000000..73ea23a
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%pack2x16snorm_6c169b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpExtInst %uint %11 PackSnorm2x16 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %pack2x16snorm_6c169b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %pack2x16snorm_6c169b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %pack2x16snorm_6c169b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl
new file mode 100644
index 0000000..33b7961
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pack2x16snorm_6c169b() {
+ var res : u32 = pack2x16snorm(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16snorm_6c169b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16snorm_6c169b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16snorm_6c169b();
+}
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl
new file mode 100644
index 0000000..7e28d98
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pack2x16unorm_0f08e4() {
+ var res: u32 = pack2x16unorm(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16unorm_0f08e4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16unorm_0f08e4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16unorm_0f08e4();
+}
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl
new file mode 100644
index 0000000..4893f30
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void pack2x16unorm_0f08e4() {
+ uint2 tint_tmp = uint2(round(clamp(float2(0.0f, 0.0f), 0.0, 1.0) * 65535.0));
+uint res = (tint_tmp.x | tint_tmp.y << 16);
+}
+
+void vertex_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
+void fragment_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl
new file mode 100644
index 0000000..4032c7a
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pack2x16unorm_0f08e4() {
+ uint res = pack_float_to_unorm2x16(float2());
+}
+
+vertex void vertex_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
+fragment void fragment_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
+kernel void compute_main() {
+ pack2x16unorm_0f08e4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm
new file mode 100644
index 0000000..bdd07e7
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantNull %v2float
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%pack2x16unorm_0f08e4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpExtInst %uint %11 PackUnorm2x16 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %pack2x16unorm_0f08e4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %pack2x16unorm_0f08e4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %pack2x16unorm_0f08e4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl
new file mode 100644
index 0000000..50a1f43
--- /dev/null
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pack2x16unorm_0f08e4() {
+ var res : u32 = pack2x16unorm(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack2x16unorm_0f08e4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack2x16unorm_0f08e4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack2x16unorm_0f08e4();
+}
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl
new file mode 100644
index 0000000..926a674
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pack4x8snorm_4d22e7() {
+ var res: u32 = pack4x8snorm(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack4x8snorm_4d22e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack4x8snorm_4d22e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack4x8snorm_4d22e7();
+}
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..fdb571f
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void pack4x8snorm_4d22e7() {
+ int4 tint_tmp = int4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), -1.0, 1.0) * 127.0)) & 0xff;
+uint res = asuint(tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24);
+}
+
+void vertex_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
+void fragment_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl
new file mode 100644
index 0000000..29469ce
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pack4x8snorm_4d22e7() {
+ uint res = pack_float_to_snorm4x8(float4());
+}
+
+vertex void vertex_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
+fragment void fragment_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
+kernel void compute_main() {
+ pack4x8snorm_4d22e7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..14c3fed
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%pack4x8snorm_4d22e7 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpExtInst %uint %11 PackSnorm4x8 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..f004930
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pack4x8snorm_4d22e7() {
+ var res : u32 = pack4x8snorm(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack4x8snorm_4d22e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack4x8snorm_4d22e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack4x8snorm_4d22e7();
+}
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl
new file mode 100644
index 0000000..7d24875
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pack4x8unorm_95c456() {
+ var res: u32 = pack4x8unorm(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack4x8unorm_95c456();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack4x8unorm_95c456();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack4x8unorm_95c456();
+}
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl
new file mode 100644
index 0000000..d28797e
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void pack4x8unorm_95c456() {
+ uint4 tint_tmp = uint4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), 0.0, 1.0) * 255.0));
+uint res = (tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24);
+}
+
+void vertex_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
+void fragment_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl
new file mode 100644
index 0000000..0871406
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pack4x8unorm_95c456() {
+ uint res = pack_float_to_unorm4x8(float4());
+}
+
+vertex void vertex_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
+fragment void fragment_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
+kernel void compute_main() {
+ pack4x8unorm_95c456();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm
new file mode 100644
index 0000000..2dd4c33
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v4float
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%pack4x8unorm_95c456 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpExtInst %uint %11 PackUnorm4x8 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %pack4x8unorm_95c456
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %pack4x8unorm_95c456
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %pack4x8unorm_95c456
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl
new file mode 100644
index 0000000..1b296f9
--- /dev/null
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pack4x8unorm_95c456() {
+ var res : u32 = pack4x8unorm(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pack4x8unorm_95c456();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pack4x8unorm_95c456();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pack4x8unorm_95c456();
+}
diff --git a/test/intrinsics/gen/pow/04a908.wgsl b/test/intrinsics/gen/pow/04a908.wgsl
new file mode 100644
index 0000000..c91e6cf
--- /dev/null
+++ b/test/intrinsics/gen/pow/04a908.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pow_04a908() {
+ var res: vec4<f32> = pow(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_04a908();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_04a908();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_04a908();
+}
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl
new file mode 100644
index 0000000..ad54235
--- /dev/null
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void pow_04a908() {
+ float4 res = pow(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ pow_04a908();
+ return;
+}
+
+void fragment_main() {
+ pow_04a908();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pow_04a908();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl
new file mode 100644
index 0000000..228e56f
--- /dev/null
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pow_04a908() {
+ float4 res = pow(float4(), float4());
+}
+
+vertex void vertex_main() {
+ pow_04a908();
+ return;
+}
+
+fragment void fragment_main() {
+ pow_04a908();
+ return;
+}
+
+kernel void compute_main() {
+ pow_04a908();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm
new file mode 100644
index 0000000..ac67719
--- /dev/null
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pow_04a908 "pow_04a908"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %pow_04a908 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Pow %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %pow_04a908
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %pow_04a908
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %pow_04a908
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl
new file mode 100644
index 0000000..cbbf4b7
--- /dev/null
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pow_04a908() {
+ var res : vec4<f32> = pow(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_04a908();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_04a908();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_04a908();
+}
diff --git a/test/intrinsics/gen/pow/46e029.wgsl b/test/intrinsics/gen/pow/46e029.wgsl
new file mode 100644
index 0000000..b373967
--- /dev/null
+++ b/test/intrinsics/gen/pow/46e029.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pow_46e029() {
+ var res: f32 = pow(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_46e029();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_46e029();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_46e029();
+}
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl
new file mode 100644
index 0000000..193aaea
--- /dev/null
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void pow_46e029() {
+ float res = pow(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ pow_46e029();
+ return;
+}
+
+void fragment_main() {
+ pow_46e029();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pow_46e029();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl
new file mode 100644
index 0000000..22cdf1f
--- /dev/null
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pow_46e029() {
+ float res = pow(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ pow_46e029();
+ return;
+}
+
+fragment void fragment_main() {
+ pow_46e029();
+ return;
+}
+
+kernel void compute_main() {
+ pow_46e029();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm
new file mode 100644
index 0000000..030a77e
--- /dev/null
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pow_46e029 "pow_46e029"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %pow_46e029 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Pow %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %pow_46e029
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %pow_46e029
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %pow_46e029
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl
new file mode 100644
index 0000000..6aae69e
--- /dev/null
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pow_46e029() {
+ var res : f32 = pow(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_46e029();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_46e029();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_46e029();
+}
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl
new file mode 100644
index 0000000..cf1801d
--- /dev/null
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pow_4a46c9() {
+ var res: vec3<f32> = pow(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_4a46c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_4a46c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_4a46c9();
+}
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl
new file mode 100644
index 0000000..4b79a21
--- /dev/null
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void pow_4a46c9() {
+ float3 res = pow(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ pow_4a46c9();
+ return;
+}
+
+void fragment_main() {
+ pow_4a46c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pow_4a46c9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl
new file mode 100644
index 0000000..e518b16
--- /dev/null
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pow_4a46c9() {
+ float3 res = pow(float3(), float3());
+}
+
+vertex void vertex_main() {
+ pow_4a46c9();
+ return;
+}
+
+fragment void fragment_main() {
+ pow_4a46c9();
+ return;
+}
+
+kernel void compute_main() {
+ pow_4a46c9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ba1ee0
--- /dev/null
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pow_4a46c9 "pow_4a46c9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %pow_4a46c9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Pow %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %pow_4a46c9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %pow_4a46c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %pow_4a46c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..c789baa
--- /dev/null
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pow_4a46c9() {
+ var res : vec3<f32> = pow(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_4a46c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_4a46c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_4a46c9();
+}
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl
new file mode 100644
index 0000000..ad3bb6c
--- /dev/null
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn pow_e60ea5() {
+ var res: vec2<f32> = pow(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_e60ea5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_e60ea5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_e60ea5();
+}
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl
new file mode 100644
index 0000000..b03968b
--- /dev/null
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void pow_e60ea5() {
+ float2 res = pow(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ pow_e60ea5();
+ return;
+}
+
+void fragment_main() {
+ pow_e60ea5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ pow_e60ea5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl
new file mode 100644
index 0000000..d957e76
--- /dev/null
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void pow_e60ea5() {
+ float2 res = pow(float2(), float2());
+}
+
+vertex void vertex_main() {
+ pow_e60ea5();
+ return;
+}
+
+fragment void fragment_main() {
+ pow_e60ea5();
+ return;
+}
+
+kernel void compute_main() {
+ pow_e60ea5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm
new file mode 100644
index 0000000..8aeb680
--- /dev/null
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %pow_e60ea5 "pow_e60ea5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %pow_e60ea5 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Pow %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %pow_e60ea5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %pow_e60ea5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %pow_e60ea5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl
new file mode 100644
index 0000000..d8c2cb6
--- /dev/null
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn pow_e60ea5() {
+ var res : vec2<f32> = pow(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ pow_e60ea5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ pow_e60ea5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ pow_e60ea5();
+}
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl
new file mode 100644
index 0000000..79795c5
--- /dev/null
+++ b/test/intrinsics/gen/reflect/05357e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reflect_05357e() {
+ var res: vec4<f32> = reflect(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_05357e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_05357e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_05357e();
+}
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl
new file mode 100644
index 0000000..8b788a2
--- /dev/null
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reflect_05357e() {
+ float4 res = reflect(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ reflect_05357e();
+ return;
+}
+
+void fragment_main() {
+ reflect_05357e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reflect_05357e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl
new file mode 100644
index 0000000..2254230
--- /dev/null
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reflect_05357e() {
+ float4 res = reflect(float4(), float4());
+}
+
+vertex void vertex_main() {
+ reflect_05357e();
+ return;
+}
+
+fragment void fragment_main() {
+ reflect_05357e();
+ return;
+}
+
+kernel void compute_main() {
+ reflect_05357e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm
new file mode 100644
index 0000000..5326fc6
--- /dev/null
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reflect_05357e "reflect_05357e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%reflect_05357e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Reflect %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reflect_05357e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reflect_05357e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reflect_05357e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl
new file mode 100644
index 0000000..5795848
--- /dev/null
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reflect_05357e() {
+ var res : vec4<f32> = reflect(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_05357e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_05357e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_05357e();
+}
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl
new file mode 100644
index 0000000..ce35141
--- /dev/null
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reflect_b61e10() {
+ var res: vec2<f32> = reflect(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_b61e10();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_b61e10();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_b61e10();
+}
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl
new file mode 100644
index 0000000..57643e7
--- /dev/null
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reflect_b61e10() {
+ float2 res = reflect(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ reflect_b61e10();
+ return;
+}
+
+void fragment_main() {
+ reflect_b61e10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reflect_b61e10();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl
new file mode 100644
index 0000000..a810e76
--- /dev/null
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reflect_b61e10() {
+ float2 res = reflect(float2(), float2());
+}
+
+vertex void vertex_main() {
+ reflect_b61e10();
+ return;
+}
+
+fragment void fragment_main() {
+ reflect_b61e10();
+ return;
+}
+
+kernel void compute_main() {
+ reflect_b61e10();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e75c23
--- /dev/null
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reflect_b61e10 "reflect_b61e10"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%reflect_b61e10 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Reflect %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reflect_b61e10
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reflect_b61e10
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reflect_b61e10
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl
new file mode 100644
index 0000000..69cebff
--- /dev/null
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reflect_b61e10() {
+ var res : vec2<f32> = reflect(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_b61e10();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_b61e10();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_b61e10();
+}
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl
new file mode 100644
index 0000000..81ce08e
--- /dev/null
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reflect_f47fdb() {
+ var res: vec3<f32> = reflect(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_f47fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_f47fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_f47fdb();
+}
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl
new file mode 100644
index 0000000..f48fec2
--- /dev/null
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reflect_f47fdb() {
+ float3 res = reflect(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ reflect_f47fdb();
+ return;
+}
+
+void fragment_main() {
+ reflect_f47fdb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reflect_f47fdb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl
new file mode 100644
index 0000000..d710cf2
--- /dev/null
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reflect_f47fdb() {
+ float3 res = reflect(float3(), float3());
+}
+
+vertex void vertex_main() {
+ reflect_f47fdb();
+ return;
+}
+
+fragment void fragment_main() {
+ reflect_f47fdb();
+ return;
+}
+
+kernel void compute_main() {
+ reflect_f47fdb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm
new file mode 100644
index 0000000..6b71c48
--- /dev/null
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reflect_f47fdb "reflect_f47fdb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%reflect_f47fdb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Reflect %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reflect_f47fdb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reflect_f47fdb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reflect_f47fdb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl
new file mode 100644
index 0000000..68fdf25
--- /dev/null
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reflect_f47fdb() {
+ var res : vec3<f32> = reflect(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_f47fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_f47fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_f47fdb();
+}
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl
new file mode 100644
index 0000000..cd1ef9f
--- /dev/null
+++ b/test/intrinsics/gen/reflect/feae90.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reflect_feae90() {
+ var res: f32 = reflect(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_feae90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_feae90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_feae90();
+}
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl
new file mode 100644
index 0000000..9be6d7b
--- /dev/null
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reflect_feae90() {
+ float res = reflect(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ reflect_feae90();
+ return;
+}
+
+void fragment_main() {
+ reflect_feae90();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reflect_feae90();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl
new file mode 100644
index 0000000..e6523fc
--- /dev/null
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl
@@ -0,0 +1,50 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void reflect_feae90() {
+ float res = reflect(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ reflect_feae90();
+ return;
+}
+
+fragment void fragment_main() {
+ reflect_feae90();
+ return;
+}
+
+kernel void compute_main() {
+ reflect_feae90();
+ return;
+}
+
+
+tint_ib1Pi6.metal:5:17: error: call to 'reflect' is ambiguous
+ float res = reflect(1.0f, 1.0f);
+ ^~~~~~~
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:315:18: note: candidate function
+METAL_FUNC half2 reflect(half2 i, half2 n)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:346:18: note: candidate function
+METAL_FUNC half3 reflect(half3 i, half3 n)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:377:18: note: candidate function
+METAL_FUNC half4 reflect(half4 i, half4 n)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:420:19: note: candidate function
+METAL_FUNC float2 reflect(float2 i, float2 n)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:463:19: note: candidate function
+METAL_FUNC float3 reflect(float3 i, float3 n)
+ ^
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:506:19: note: candidate function
+METAL_FUNC float4 reflect(float4 i, float4 n)
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8f0680
--- /dev/null
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reflect_feae90 "reflect_feae90"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%reflect_feae90 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Reflect %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %reflect_feae90
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %reflect_feae90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %reflect_feae90
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl
new file mode 100644
index 0000000..7b3a23b
--- /dev/null
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reflect_feae90() {
+ var res : f32 = reflect(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reflect_feae90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reflect_feae90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reflect_feae90();
+}
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl
new file mode 100644
index 0000000..01dc289
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_222177() {
+ var res: vec2<i32> = reverseBits(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_222177();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_222177();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_222177();
+}
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl
new file mode 100644
index 0000000..f4c8e99
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_222177() {
+ int2 res = reversebits(int2(0, 0));
+}
+
+void vertex_main() {
+ reverseBits_222177();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_222177();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_222177();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl
new file mode 100644
index 0000000..e4cc0b3
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_222177() {
+ int2 res = reverse_bits(int2());
+}
+
+vertex void vertex_main() {
+ reverseBits_222177();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_222177();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_222177();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm
new file mode 100644
index 0000000..f180cb1
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_222177 "reverseBits_222177"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %12 = OpConstantNull %v2int
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+%reverseBits_222177 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %12
+ %9 = OpBitReverse %v2int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_222177
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_222177
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_222177
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl
new file mode 100644
index 0000000..bf364aa
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_222177() {
+ var res : vec2<i32> = reverseBits(vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_222177();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_222177();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_222177();
+}
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl
new file mode 100644
index 0000000..4a85781
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_35fea9() {
+ var res: vec4<u32> = reverseBits(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_35fea9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_35fea9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_35fea9();
+}
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl
new file mode 100644
index 0000000..da3cf17
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_35fea9() {
+ uint4 res = reversebits(uint4(0u, 0u, 0u, 0u));
+}
+
+void vertex_main() {
+ reverseBits_35fea9();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_35fea9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_35fea9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl
new file mode 100644
index 0000000..7aea816
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_35fea9() {
+ uint4 res = reverse_bits(uint4());
+}
+
+vertex void vertex_main() {
+ reverseBits_35fea9();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_35fea9();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_35fea9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm
new file mode 100644
index 0000000..114d8da
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_35fea9 "reverseBits_35fea9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %12 = OpConstantNull %v4uint
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+%reverseBits_35fea9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %12
+ %9 = OpBitReverse %v4uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_35fea9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_35fea9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_35fea9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl
new file mode 100644
index 0000000..850bc8f
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_35fea9() {
+ var res : vec4<u32> = reverseBits(vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_35fea9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_35fea9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_35fea9();
+}
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl
new file mode 100644
index 0000000..ecb8851
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_4dbd6f() {
+ var res: vec4<i32> = reverseBits(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_4dbd6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_4dbd6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_4dbd6f();
+}
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl
new file mode 100644
index 0000000..3d0d9f8
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_4dbd6f() {
+ int4 res = reversebits(int4(0, 0, 0, 0));
+}
+
+void vertex_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl
new file mode 100644
index 0000000..f73e0c6
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_4dbd6f() {
+ int4 res = reverse_bits(int4());
+}
+
+vertex void vertex_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_4dbd6f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm
new file mode 100644
index 0000000..35d075f
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_4dbd6f "reverseBits_4dbd6f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %12 = OpConstantNull %v4int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+%reverseBits_4dbd6f = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %12
+ %9 = OpBitReverse %v4int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_4dbd6f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_4dbd6f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_4dbd6f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl
new file mode 100644
index 0000000..282a3c5
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_4dbd6f() {
+ var res : vec4<i32> = reverseBits(vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_4dbd6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_4dbd6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_4dbd6f();
+}
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl
new file mode 100644
index 0000000..3528f06
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_7c4269() {
+ var res: i32 = reverseBits(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_7c4269();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_7c4269();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_7c4269();
+}
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl
new file mode 100644
index 0000000..871fbfc
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_7c4269() {
+ int res = reversebits(1);
+}
+
+void vertex_main() {
+ reverseBits_7c4269();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_7c4269();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_7c4269();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl
new file mode 100644
index 0000000..07d3509
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_7c4269() {
+ int res = reverse_bits(1);
+}
+
+vertex void vertex_main() {
+ reverseBits_7c4269();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_7c4269();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_7c4269();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm
new file mode 100644
index 0000000..c7b168a
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_7c4269 "reverseBits_7c4269"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %14 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%reverseBits_7c4269 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %14
+ %9 = OpBitReverse %int %int_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_7c4269
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_7c4269
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_7c4269
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl
new file mode 100644
index 0000000..3571b73
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_7c4269() {
+ var res : i32 = reverseBits(1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_7c4269();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_7c4269();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_7c4269();
+}
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl
new file mode 100644
index 0000000..960cb70
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_a6ccd4() {
+ var res: vec3<u32> = reverseBits(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_a6ccd4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_a6ccd4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_a6ccd4();
+}
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl
new file mode 100644
index 0000000..8a15354
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_a6ccd4() {
+ uint3 res = reversebits(uint3(0u, 0u, 0u));
+}
+
+void vertex_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl
new file mode 100644
index 0000000..73b5497
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_a6ccd4() {
+ uint3 res = reverse_bits(uint3());
+}
+
+vertex void vertex_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_a6ccd4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm
new file mode 100644
index 0000000..51617d4
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %12 = OpConstantNull %v3uint
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+%reverseBits_a6ccd4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %12
+ %9 = OpBitReverse %v3uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_a6ccd4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_a6ccd4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_a6ccd4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl
new file mode 100644
index 0000000..118301b
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_a6ccd4() {
+ var res : vec3<u32> = reverseBits(vec3<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_a6ccd4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_a6ccd4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_a6ccd4();
+}
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl
new file mode 100644
index 0000000..aab692d
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_c21bc1() {
+ var res: vec3<i32> = reverseBits(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_c21bc1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_c21bc1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_c21bc1();
+}
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl
new file mode 100644
index 0000000..fcf618a
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_c21bc1() {
+ int3 res = reversebits(int3(0, 0, 0));
+}
+
+void vertex_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl
new file mode 100644
index 0000000..45aa86e
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_c21bc1() {
+ int3 res = reverse_bits(int3());
+}
+
+vertex void vertex_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_c21bc1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1f24721
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_c21bc1 "reverseBits_c21bc1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %12 = OpConstantNull %v3int
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+%reverseBits_c21bc1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %12
+ %9 = OpBitReverse %v3int %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_c21bc1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_c21bc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_c21bc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..adb06da
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_c21bc1() {
+ var res : vec3<i32> = reverseBits(vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_c21bc1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_c21bc1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_c21bc1();
+}
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl
new file mode 100644
index 0000000..238cba0
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_e1f4c1() {
+ var res: vec2<u32> = reverseBits(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_e1f4c1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_e1f4c1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_e1f4c1();
+}
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl
new file mode 100644
index 0000000..faf8a49
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_e1f4c1() {
+ uint2 res = reversebits(uint2(0u, 0u));
+}
+
+void vertex_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl
new file mode 100644
index 0000000..7c2a685
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_e1f4c1() {
+ uint2 res = reverse_bits(uint2());
+}
+
+vertex void vertex_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_e1f4c1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm
new file mode 100644
index 0000000..35a6db0
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %12 = OpConstantNull %v2uint
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+%reverseBits_e1f4c1 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %12
+ %9 = OpBitReverse %v2uint %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_e1f4c1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_e1f4c1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_e1f4c1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl
new file mode 100644
index 0000000..7676c94
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_e1f4c1() {
+ var res : vec2<u32> = reverseBits(vec2<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_e1f4c1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_e1f4c1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_e1f4c1();
+}
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl
new file mode 100644
index 0000000..6f8855d
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn reverseBits_e31adf() {
+ var res: u32 = reverseBits(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_e31adf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_e31adf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_e31adf();
+}
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl
new file mode 100644
index 0000000..245c726
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void reverseBits_e31adf() {
+ uint res = reversebits(1u);
+}
+
+void vertex_main() {
+ reverseBits_e31adf();
+ return;
+}
+
+void fragment_main() {
+ reverseBits_e31adf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ reverseBits_e31adf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl
new file mode 100644
index 0000000..eb2b65c
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void reverseBits_e31adf() {
+ uint res = reverse_bits(1u);
+}
+
+vertex void vertex_main() {
+ reverseBits_e31adf();
+ return;
+}
+
+fragment void fragment_main() {
+ reverseBits_e31adf();
+ return;
+}
+
+kernel void compute_main() {
+ reverseBits_e31adf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9e3f25
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %reverseBits_e31adf "reverseBits_e31adf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %14 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%reverseBits_e31adf = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %14
+ %9 = OpBitReverse %uint %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %reverseBits_e31adf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %reverseBits_e31adf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %reverseBits_e31adf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl
new file mode 100644
index 0000000..c3a3a48
--- /dev/null
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn reverseBits_e31adf() {
+ var res : u32 = reverseBits(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ reverseBits_e31adf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ reverseBits_e31adf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ reverseBits_e31adf();
+}
diff --git a/test/intrinsics/gen/round/106c0b.wgsl b/test/intrinsics/gen/round/106c0b.wgsl
new file mode 100644
index 0000000..d8b36ba
--- /dev/null
+++ b/test/intrinsics/gen/round/106c0b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn round_106c0b() {
+ var res: vec4<f32> = round(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_106c0b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_106c0b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_106c0b();
+}
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl
new file mode 100644
index 0000000..1d5a479
--- /dev/null
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void round_106c0b() {
+ float4 res = round(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ round_106c0b();
+ return;
+}
+
+void fragment_main() {
+ round_106c0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ round_106c0b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl
new file mode 100644
index 0000000..460fcfa
--- /dev/null
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_106c0b() {
+ float4 res = rint(float4());
+}
+
+vertex void vertex_main() {
+ round_106c0b();
+ return;
+}
+
+fragment void fragment_main() {
+ round_106c0b();
+ return;
+}
+
+kernel void compute_main() {
+ round_106c0b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm
new file mode 100644
index 0000000..1a45662
--- /dev/null
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %round_106c0b "round_106c0b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%round_106c0b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 RoundEven %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %round_106c0b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %round_106c0b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %round_106c0b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl
new file mode 100644
index 0000000..454fbb1
--- /dev/null
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn round_106c0b() {
+ var res : vec4<f32> = round(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_106c0b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_106c0b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_106c0b();
+}
diff --git a/test/intrinsics/gen/round/1c7897.wgsl b/test/intrinsics/gen/round/1c7897.wgsl
new file mode 100644
index 0000000..48f1a1f
--- /dev/null
+++ b/test/intrinsics/gen/round/1c7897.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn round_1c7897() {
+ var res: vec3<f32> = round(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_1c7897();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_1c7897();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_1c7897();
+}
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl
new file mode 100644
index 0000000..ca4d1b8
--- /dev/null
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void round_1c7897() {
+ float3 res = round(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ round_1c7897();
+ return;
+}
+
+void fragment_main() {
+ round_1c7897();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ round_1c7897();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl
new file mode 100644
index 0000000..567828b
--- /dev/null
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_1c7897() {
+ float3 res = rint(float3());
+}
+
+vertex void vertex_main() {
+ round_1c7897();
+ return;
+}
+
+fragment void fragment_main() {
+ round_1c7897();
+ return;
+}
+
+kernel void compute_main() {
+ round_1c7897();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm
new file mode 100644
index 0000000..81b1781
--- /dev/null
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %round_1c7897 "round_1c7897"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%round_1c7897 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 RoundEven %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %round_1c7897
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %round_1c7897
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %round_1c7897
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl
new file mode 100644
index 0000000..ab42e01
--- /dev/null
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn round_1c7897() {
+ var res : vec3<f32> = round(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_1c7897();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_1c7897();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_1c7897();
+}
diff --git a/test/intrinsics/gen/round/52c84d.wgsl b/test/intrinsics/gen/round/52c84d.wgsl
new file mode 100644
index 0000000..189a1d5
--- /dev/null
+++ b/test/intrinsics/gen/round/52c84d.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn round_52c84d() {
+ var res: vec2<f32> = round(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_52c84d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_52c84d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_52c84d();
+}
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl
new file mode 100644
index 0000000..948707e
--- /dev/null
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void round_52c84d() {
+ float2 res = round(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ round_52c84d();
+ return;
+}
+
+void fragment_main() {
+ round_52c84d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ round_52c84d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl
new file mode 100644
index 0000000..8b8b6d6
--- /dev/null
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_52c84d() {
+ float2 res = rint(float2());
+}
+
+vertex void vertex_main() {
+ round_52c84d();
+ return;
+}
+
+fragment void fragment_main() {
+ round_52c84d();
+ return;
+}
+
+kernel void compute_main() {
+ round_52c84d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm
new file mode 100644
index 0000000..d3a9a9a
--- /dev/null
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %round_52c84d "round_52c84d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%round_52c84d = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 RoundEven %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %round_52c84d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %round_52c84d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %round_52c84d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl
new file mode 100644
index 0000000..9243a33
--- /dev/null
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn round_52c84d() {
+ var res : vec2<f32> = round(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_52c84d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_52c84d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_52c84d();
+}
diff --git a/test/intrinsics/gen/round/9edc38.wgsl b/test/intrinsics/gen/round/9edc38.wgsl
new file mode 100644
index 0000000..549a6b7
--- /dev/null
+++ b/test/intrinsics/gen/round/9edc38.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn round_9edc38() {
+ var res: f32 = round(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_9edc38();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_9edc38();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_9edc38();
+}
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl
new file mode 100644
index 0000000..1cebde8
--- /dev/null
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void round_9edc38() {
+ float res = round(1.0f);
+}
+
+void vertex_main() {
+ round_9edc38();
+ return;
+}
+
+void fragment_main() {
+ round_9edc38();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ round_9edc38();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl
new file mode 100644
index 0000000..bf4f2ab
--- /dev/null
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_9edc38() {
+ float res = rint(1.0f);
+}
+
+vertex void vertex_main() {
+ round_9edc38();
+ return;
+}
+
+fragment void fragment_main() {
+ round_9edc38();
+ return;
+}
+
+kernel void compute_main() {
+ round_9edc38();
+ return;
+}
+
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm
new file mode 100644
index 0000000..8d34914
--- /dev/null
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %round_9edc38 "round_9edc38"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%round_9edc38 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 RoundEven %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %round_9edc38
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %round_9edc38
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %round_9edc38
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcb59dc
--- /dev/null
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn round_9edc38() {
+ var res : f32 = round(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ round_9edc38();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ round_9edc38();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ round_9edc38();
+}
diff --git a/test/intrinsics/gen/select/00b848.wgsl b/test/intrinsics/gen/select/00b848.wgsl
new file mode 100644
index 0000000..61e3913
--- /dev/null
+++ b/test/intrinsics/gen/select/00b848.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_00b848() {
+ var res: vec2<i32> = select(vec2<i32>(), vec2<i32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_00b848();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_00b848();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_00b848();
+}
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl b/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl
new file mode 100644
index 0000000..813c530
--- /dev/null
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_00b848() {
+ var res : vec2<i32> = select(vec2<i32>(), vec2<i32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_00b848();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_00b848();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_00b848();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.msl b/test/intrinsics/gen/select/00b848.wgsl.expected.msl
new file mode 100644
index 0000000..426deef
--- /dev/null
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_00b848() {
+ int2 res = select(int2(), int2(), bool2());
+}
+
+vertex void vertex_main() {
+ select_00b848();
+ return;
+}
+
+fragment void fragment_main() {
+ select_00b848();
+ return;
+}
+
+kernel void compute_main() {
+ select_00b848();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm b/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm
new file mode 100644
index 0000000..032991f
--- /dev/null
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_00b848 "select_00b848"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %12 = OpConstantNull %v2int
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %15 = OpConstantNull %v2bool
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %float_1 = OpConstant %float 1
+%select_00b848 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %12
+ %9 = OpSelect %v2int %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_00b848
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_00b848
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_00b848
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v2int %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl
new file mode 100644
index 0000000..afae377
--- /dev/null
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_00b848() {
+ var res : vec2<i32> = select(vec2<i32>(), vec2<i32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_00b848();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_00b848();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_00b848();
+}
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl
new file mode 100644
index 0000000..79c24e4
--- /dev/null
+++ b/test/intrinsics/gen/select/01e2cd.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_01e2cd() {
+ var res: vec3<i32> = select(vec3<i32>(), vec3<i32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_01e2cd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_01e2cd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_01e2cd();
+}
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl
new file mode 100644
index 0000000..a59ac84
--- /dev/null
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_01e2cd() {
+ var res : vec3<i32> = select(vec3<i32>(), vec3<i32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_01e2cd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_01e2cd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_01e2cd();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl
new file mode 100644
index 0000000..652bb8b
--- /dev/null
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_01e2cd() {
+ int3 res = select(int3(), int3(), bool3());
+}
+
+vertex void vertex_main() {
+ select_01e2cd();
+ return;
+}
+
+fragment void fragment_main() {
+ select_01e2cd();
+ return;
+}
+
+kernel void compute_main() {
+ select_01e2cd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm b/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm
new file mode 100644
index 0000000..f0402bc
--- /dev/null
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_01e2cd "select_01e2cd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %12 = OpConstantNull %v3int
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %15 = OpConstantNull %v3bool
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %float_1 = OpConstant %float 1
+%select_01e2cd = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %12
+ %9 = OpSelect %v3int %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_01e2cd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_01e2cd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_01e2cd
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v3int %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl
new file mode 100644
index 0000000..8cc641b
--- /dev/null
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_01e2cd() {
+ var res : vec3<i32> = select(vec3<i32>(), vec3<i32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_01e2cd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_01e2cd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_01e2cd();
+}
diff --git a/test/intrinsics/gen/select/1e960b.wgsl b/test/intrinsics/gen/select/1e960b.wgsl
new file mode 100644
index 0000000..94fc946
--- /dev/null
+++ b/test/intrinsics/gen/select/1e960b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_1e960b() {
+ var res: vec2<u32> = select(vec2<u32>(), vec2<u32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_1e960b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_1e960b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_1e960b();
+}
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl
new file mode 100644
index 0000000..2ad2b34
--- /dev/null
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_1e960b() {
+ var res : vec2<u32> = select(vec2<u32>(), vec2<u32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_1e960b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_1e960b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_1e960b();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl
new file mode 100644
index 0000000..7b9cc56
--- /dev/null
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_1e960b() {
+ uint2 res = select(uint2(), uint2(), bool2());
+}
+
+vertex void vertex_main() {
+ select_1e960b();
+ return;
+}
+
+fragment void fragment_main() {
+ select_1e960b();
+ return;
+}
+
+kernel void compute_main() {
+ select_1e960b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm b/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm
new file mode 100644
index 0000000..2f41bf0
--- /dev/null
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_1e960b "select_1e960b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %12 = OpConstantNull %v2uint
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %15 = OpConstantNull %v2bool
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %float_1 = OpConstant %float 1
+%select_1e960b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %12
+ %9 = OpSelect %v2uint %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_1e960b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_1e960b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_1e960b
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v2uint %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl
new file mode 100644
index 0000000..bbf9f1c
--- /dev/null
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_1e960b() {
+ var res : vec2<u32> = select(vec2<u32>(), vec2<u32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_1e960b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_1e960b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_1e960b();
+}
diff --git a/test/intrinsics/gen/select/266aff.wgsl b/test/intrinsics/gen/select/266aff.wgsl
new file mode 100644
index 0000000..6ad4aeb
--- /dev/null
+++ b/test/intrinsics/gen/select/266aff.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_266aff() {
+ var res: vec2<f32> = select(vec2<f32>(), vec2<f32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_266aff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_266aff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_266aff();
+}
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl b/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl
new file mode 100644
index 0000000..7fa28bc
--- /dev/null
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_266aff() {
+ var res : vec2<f32> = select(vec2<f32>(), vec2<f32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_266aff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_266aff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_266aff();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.msl b/test/intrinsics/gen/select/266aff.wgsl.expected.msl
new file mode 100644
index 0000000..9e2b612
--- /dev/null
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_266aff() {
+ float2 res = select(float2(), float2(), bool2());
+}
+
+vertex void vertex_main() {
+ select_266aff();
+ return;
+}
+
+fragment void fragment_main() {
+ select_266aff();
+ return;
+}
+
+kernel void compute_main() {
+ select_266aff();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm b/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm
new file mode 100644
index 0000000..d68b98f
--- /dev/null
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_266aff "select_266aff"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %11 = OpConstantNull %v2float
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %14 = OpConstantNull %v2bool
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%select_266aff = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %11
+ %9 = OpSelect %v2float %11 %11 %14
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %select_266aff
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_266aff
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %select_266aff
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v2float %11 %11 %14
+
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl
new file mode 100644
index 0000000..2b269b7
--- /dev/null
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_266aff() {
+ var res : vec2<f32> = select(vec2<f32>(), vec2<f32>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_266aff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_266aff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_266aff();
+}
diff --git a/test/intrinsics/gen/select/28a27e.wgsl b/test/intrinsics/gen/select/28a27e.wgsl
new file mode 100644
index 0000000..1eb6bba
--- /dev/null
+++ b/test/intrinsics/gen/select/28a27e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_28a27e() {
+ var res: vec3<u32> = select(vec3<u32>(), vec3<u32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_28a27e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_28a27e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_28a27e();
+}
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl
new file mode 100644
index 0000000..51b8dcb
--- /dev/null
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_28a27e() {
+ var res : vec3<u32> = select(vec3<u32>(), vec3<u32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_28a27e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_28a27e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_28a27e();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl
new file mode 100644
index 0000000..2e6f617
--- /dev/null
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_28a27e() {
+ uint3 res = select(uint3(), uint3(), bool3());
+}
+
+vertex void vertex_main() {
+ select_28a27e();
+ return;
+}
+
+fragment void fragment_main() {
+ select_28a27e();
+ return;
+}
+
+kernel void compute_main() {
+ select_28a27e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm b/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm
new file mode 100644
index 0000000..ccbff5a
--- /dev/null
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_28a27e "select_28a27e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %12 = OpConstantNull %v3uint
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %15 = OpConstantNull %v3bool
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %float_1 = OpConstant %float 1
+%select_28a27e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %12
+ %9 = OpSelect %v3uint %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_28a27e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_28a27e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_28a27e
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v3uint %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl
new file mode 100644
index 0000000..fc8858f
--- /dev/null
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_28a27e() {
+ var res : vec3<u32> = select(vec3<u32>(), vec3<u32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_28a27e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_28a27e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_28a27e();
+}
diff --git a/test/intrinsics/gen/select/416e14.wgsl b/test/intrinsics/gen/select/416e14.wgsl
new file mode 100644
index 0000000..0dd6b76
--- /dev/null
+++ b/test/intrinsics/gen/select/416e14.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_416e14() {
+ var res: f32 = select(1.0, 1.0, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_416e14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_416e14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_416e14();
+}
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl b/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl
new file mode 100644
index 0000000..f2cabc0
--- /dev/null
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_416e14() {
+ var res : f32 = select(1.0, 1.0, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_416e14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_416e14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_416e14();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.msl b/test/intrinsics/gen/select/416e14.wgsl.expected.msl
new file mode 100644
index 0000000..376f282
--- /dev/null
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_416e14() {
+ float res = select(1.0f, 1.0f, bool());
+}
+
+vertex void vertex_main() {
+ select_416e14();
+ return;
+}
+
+fragment void fragment_main() {
+ select_416e14();
+ return;
+}
+
+kernel void compute_main() {
+ select_416e14();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm b/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm
new file mode 100644
index 0000000..44079c1
--- /dev/null
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_416e14 "select_416e14"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+ %bool = OpTypeBool
+ %12 = OpConstantNull %bool
+%_ptr_Function_float = OpTypePointer Function %float
+%select_416e14 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpSelect %float %float_1 %float_1 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %select_416e14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %select_416e14
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_416e14
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %float %float_1 %float_1 %12
+
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl
new file mode 100644
index 0000000..d44749c
--- /dev/null
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_416e14() {
+ var res : f32 = select(1.0, 1.0, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_416e14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_416e14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_416e14();
+}
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl
new file mode 100644
index 0000000..089c979
--- /dev/null
+++ b/test/intrinsics/gen/select/80a9a9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_80a9a9() {
+ var res: vec3<bool> = select(vec3<bool>(), vec3<bool>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_80a9a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_80a9a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_80a9a9();
+}
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl
new file mode 100644
index 0000000..784f9fd
--- /dev/null
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_80a9a9() {
+ var res : vec3<bool> = select(vec3<bool>(), vec3<bool>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_80a9a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_80a9a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_80a9a9();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl
new file mode 100644
index 0000000..0263844
--- /dev/null
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_80a9a9() {
+ bool3 res = select(bool3(), bool3(), bool3());
+}
+
+vertex void vertex_main() {
+ select_80a9a9();
+ return;
+}
+
+fragment void fragment_main() {
+ select_80a9a9();
+ return;
+}
+
+kernel void compute_main() {
+ select_80a9a9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm
new file mode 100644
index 0000000..34b464e
--- /dev/null
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_80a9a9 "select_80a9a9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %12 = OpConstantNull %v3bool
+%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %float_1 = OpConstant %float 1
+%select_80a9a9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %12
+ %9 = OpSelect %v3bool %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %select_80a9a9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %select_80a9a9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_80a9a9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl
new file mode 100644
index 0000000..52d6efe
--- /dev/null
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_80a9a9() {
+ var res : vec3<bool> = select(vec3<bool>(), vec3<bool>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_80a9a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_80a9a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_80a9a9();
+}
diff --git a/test/intrinsics/gen/select/99f883.wgsl b/test/intrinsics/gen/select/99f883.wgsl
new file mode 100644
index 0000000..7c078a0
--- /dev/null
+++ b/test/intrinsics/gen/select/99f883.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_99f883() {
+ var res: u32 = select(1u, 1u, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_99f883();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_99f883();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_99f883();
+}
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl b/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl
new file mode 100644
index 0000000..7c30f9a
--- /dev/null
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_99f883() {
+ var res : u32 = select(1u, 1u, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_99f883();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_99f883();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_99f883();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.msl b/test/intrinsics/gen/select/99f883.wgsl.expected.msl
new file mode 100644
index 0000000..8332072
--- /dev/null
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_99f883() {
+ uint res = select(1u, 1u, bool());
+}
+
+vertex void vertex_main() {
+ select_99f883();
+ return;
+}
+
+fragment void fragment_main() {
+ select_99f883();
+ return;
+}
+
+kernel void compute_main() {
+ select_99f883();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm b/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm
new file mode 100644
index 0000000..9452dff
--- /dev/null
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_99f883 "select_99f883"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %bool = OpTypeBool
+ %13 = OpConstantNull %bool
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %16 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+%select_99f883 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %16
+ %9 = OpSelect %uint %uint_1 %uint_1 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %select_99f883
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_99f883
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %select_99f883
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %uint %uint_1 %uint_1 %13
+
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl
new file mode 100644
index 0000000..6dd41c7
--- /dev/null
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_99f883() {
+ var res : u32 = select(1u, 1u, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_99f883();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_99f883();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_99f883();
+}
diff --git a/test/intrinsics/gen/select/a2860e.wgsl b/test/intrinsics/gen/select/a2860e.wgsl
new file mode 100644
index 0000000..1df8bf5
--- /dev/null
+++ b/test/intrinsics/gen/select/a2860e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_a2860e() {
+ var res: vec4<i32> = select(vec4<i32>(), vec4<i32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_a2860e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_a2860e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_a2860e();
+}
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl
new file mode 100644
index 0000000..06245b9
--- /dev/null
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_a2860e() {
+ var res : vec4<i32> = select(vec4<i32>(), vec4<i32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_a2860e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_a2860e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_a2860e();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl
new file mode 100644
index 0000000..aacb8ce
--- /dev/null
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_a2860e() {
+ int4 res = select(int4(), int4(), bool4());
+}
+
+vertex void vertex_main() {
+ select_a2860e();
+ return;
+}
+
+fragment void fragment_main() {
+ select_a2860e();
+ return;
+}
+
+kernel void compute_main() {
+ select_a2860e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm b/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm
new file mode 100644
index 0000000..cdc8be8
--- /dev/null
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_a2860e "select_a2860e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+ %12 = OpConstantNull %v4int
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %15 = OpConstantNull %v4bool
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %float_1 = OpConstant %float 1
+%select_a2860e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %12
+ %9 = OpSelect %v4int %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_a2860e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_a2860e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_a2860e
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v4int %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl
new file mode 100644
index 0000000..e7cb1ea
--- /dev/null
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_a2860e() {
+ var res : vec4<i32> = select(vec4<i32>(), vec4<i32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_a2860e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_a2860e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_a2860e();
+}
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl
new file mode 100644
index 0000000..8806956
--- /dev/null
+++ b/test/intrinsics/gen/select/bb8aae.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_bb8aae() {
+ var res: vec4<f32> = select(vec4<f32>(), vec4<f32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_bb8aae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_bb8aae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_bb8aae();
+}
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl
new file mode 100644
index 0000000..b057c7f
--- /dev/null
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_bb8aae() {
+ var res : vec4<f32> = select(vec4<f32>(), vec4<f32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_bb8aae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_bb8aae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_bb8aae();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl
new file mode 100644
index 0000000..a2418f5
--- /dev/null
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_bb8aae() {
+ float4 res = select(float4(), float4(), bool4());
+}
+
+vertex void vertex_main() {
+ select_bb8aae();
+ return;
+}
+
+fragment void fragment_main() {
+ select_bb8aae();
+ return;
+}
+
+kernel void compute_main() {
+ select_bb8aae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm b/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm
new file mode 100644
index 0000000..6e2774d
--- /dev/null
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_bb8aae "select_bb8aae"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %11 = OpConstantNull %v4float
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %14 = OpConstantNull %v4bool
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%select_bb8aae = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %9 = OpSelect %v4float %11 %11 %14
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %select_bb8aae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_bb8aae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %select_bb8aae
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v4float %11 %11 %14
+
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl
new file mode 100644
index 0000000..85e05cf
--- /dev/null
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_bb8aae() {
+ var res : vec4<f32> = select(vec4<f32>(), vec4<f32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_bb8aae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_bb8aae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_bb8aae();
+}
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl
new file mode 100644
index 0000000..d721803
--- /dev/null
+++ b/test/intrinsics/gen/select/c31f9e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_c31f9e() {
+ var res: bool = select(bool(), bool(), bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c31f9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c31f9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c31f9e();
+}
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl
new file mode 100644
index 0000000..65ab282
--- /dev/null
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_c31f9e() {
+ var res : bool = select(bool(), bool(), bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c31f9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c31f9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c31f9e();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl
new file mode 100644
index 0000000..6719974
--- /dev/null
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_c31f9e() {
+ bool res = select(bool(), bool(), bool());
+}
+
+vertex void vertex_main() {
+ select_c31f9e();
+ return;
+}
+
+fragment void fragment_main() {
+ select_c31f9e();
+ return;
+}
+
+kernel void compute_main() {
+ select_c31f9e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..c0961e9
--- /dev/null
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 24
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_c31f9e "select_c31f9e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %11 = OpConstantNull %bool
+%_ptr_Function_bool = OpTypePointer Function %bool
+ %float_1 = OpConstant %float 1
+%select_c31f9e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %11
+ %9 = OpSelect %bool %11 %11 %11
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %17 = OpFunctionCall %void %select_c31f9e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %select_c31f9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_c31f9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..7ffd827
--- /dev/null
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_c31f9e() {
+ var res : bool = select(bool(), bool(), bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c31f9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c31f9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c31f9e();
+}
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl
new file mode 100644
index 0000000..254b37b
--- /dev/null
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_c4a4ef() {
+ var res: vec4<u32> = select(vec4<u32>(), vec4<u32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c4a4ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c4a4ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c4a4ef();
+}
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl
new file mode 100644
index 0000000..00ad061
--- /dev/null
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_c4a4ef() {
+ var res : vec4<u32> = select(vec4<u32>(), vec4<u32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c4a4ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c4a4ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c4a4ef();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl
new file mode 100644
index 0000000..65a42ac
--- /dev/null
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_c4a4ef() {
+ uint4 res = select(uint4(), uint4(), bool4());
+}
+
+vertex void vertex_main() {
+ select_c4a4ef();
+ return;
+}
+
+fragment void fragment_main() {
+ select_c4a4ef();
+ return;
+}
+
+kernel void compute_main() {
+ select_c4a4ef();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm
new file mode 100644
index 0000000..6c83621
--- /dev/null
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_c4a4ef "select_c4a4ef"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v4uint = OpTypeVector %uint 4
+ %12 = OpConstantNull %v4uint
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %15 = OpConstantNull %v4bool
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %float_1 = OpConstant %float 1
+%select_c4a4ef = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %12
+ %9 = OpSelect %v4uint %12 %12 %15
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %select_c4a4ef
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_c4a4ef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %select_c4a4ef
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v4uint %12 %12 %15
+
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl
new file mode 100644
index 0000000..4338ad6
--- /dev/null
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_c4a4ef() {
+ var res : vec4<u32> = select(vec4<u32>(), vec4<u32>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_c4a4ef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_c4a4ef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_c4a4ef();
+}
diff --git a/test/intrinsics/gen/select/cb9301.wgsl b/test/intrinsics/gen/select/cb9301.wgsl
new file mode 100644
index 0000000..968cf2c
--- /dev/null
+++ b/test/intrinsics/gen/select/cb9301.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_cb9301() {
+ var res: vec2<bool> = select(vec2<bool>(), vec2<bool>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_cb9301();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_cb9301();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_cb9301();
+}
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl
new file mode 100644
index 0000000..3c9013c
--- /dev/null
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_cb9301() {
+ var res : vec2<bool> = select(vec2<bool>(), vec2<bool>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_cb9301();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_cb9301();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_cb9301();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl
new file mode 100644
index 0000000..ffdbe51
--- /dev/null
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_cb9301() {
+ bool2 res = select(bool2(), bool2(), bool2());
+}
+
+vertex void vertex_main() {
+ select_cb9301();
+ return;
+}
+
+fragment void fragment_main() {
+ select_cb9301();
+ return;
+}
+
+kernel void compute_main() {
+ select_cb9301();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd00a77
--- /dev/null
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_cb9301 "select_cb9301"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v2bool = OpTypeVector %bool 2
+ %12 = OpConstantNull %v2bool
+%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %float_1 = OpConstant %float 1
+%select_cb9301 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %12
+ %9 = OpSelect %v2bool %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %select_cb9301
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %select_cb9301
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_cb9301
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d7c05e
--- /dev/null
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_cb9301() {
+ var res : vec2<bool> = select(vec2<bool>(), vec2<bool>(), vec2<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_cb9301();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_cb9301();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_cb9301();
+}
diff --git a/test/intrinsics/gen/select/e3e028.wgsl b/test/intrinsics/gen/select/e3e028.wgsl
new file mode 100644
index 0000000..9b613b0
--- /dev/null
+++ b/test/intrinsics/gen/select/e3e028.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_e3e028() {
+ var res: vec4<bool> = select(vec4<bool>(), vec4<bool>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_e3e028();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_e3e028();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_e3e028();
+}
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl
new file mode 100644
index 0000000..31a4f02
--- /dev/null
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_e3e028() {
+ var res : vec4<bool> = select(vec4<bool>(), vec4<bool>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_e3e028();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_e3e028();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_e3e028();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl
new file mode 100644
index 0000000..67d331c
--- /dev/null
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_e3e028() {
+ bool4 res = select(bool4(), bool4(), bool4());
+}
+
+vertex void vertex_main() {
+ select_e3e028();
+ return;
+}
+
+fragment void fragment_main() {
+ select_e3e028();
+ return;
+}
+
+kernel void compute_main() {
+ select_e3e028();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm
new file mode 100644
index 0000000..9a327a1
--- /dev/null
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_e3e028 "select_e3e028"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %v4bool = OpTypeVector %bool 4
+ %12 = OpConstantNull %v4bool
+%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %float_1 = OpConstant %float 1
+%select_e3e028 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %12
+ %9 = OpSelect %v4bool %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %select_e3e028
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %select_e3e028
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %select_e3e028
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl
new file mode 100644
index 0000000..edf186d
--- /dev/null
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_e3e028() {
+ var res : vec4<bool> = select(vec4<bool>(), vec4<bool>(), vec4<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_e3e028();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_e3e028();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_e3e028();
+}
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl
new file mode 100644
index 0000000..994a427
--- /dev/null
+++ b/test/intrinsics/gen/select/ebfea2.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_ebfea2() {
+ var res: vec3<f32> = select(vec3<f32>(), vec3<f32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ebfea2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ebfea2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ebfea2();
+}
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl
new file mode 100644
index 0000000..9889d93
--- /dev/null
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_ebfea2() {
+ var res : vec3<f32> = select(vec3<f32>(), vec3<f32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ebfea2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ebfea2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ebfea2();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl
new file mode 100644
index 0000000..c1a1253
--- /dev/null
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_ebfea2() {
+ float3 res = select(float3(), float3(), bool3());
+}
+
+vertex void vertex_main() {
+ select_ebfea2();
+ return;
+}
+
+fragment void fragment_main() {
+ select_ebfea2();
+ return;
+}
+
+kernel void compute_main() {
+ select_ebfea2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm b/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm
new file mode 100644
index 0000000..2f1df03
--- /dev/null
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_ebfea2 "select_ebfea2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %11 = OpConstantNull %v3float
+ %bool = OpTypeBool
+ %v3bool = OpTypeVector %bool 3
+ %14 = OpConstantNull %v3bool
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%select_ebfea2 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %11
+ %9 = OpSelect %v3float %11 %11 %14
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %select_ebfea2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_ebfea2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %select_ebfea2
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %v3float %11 %11 %14
+
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl
new file mode 100644
index 0000000..15cda7c
--- /dev/null
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_ebfea2() {
+ var res : vec3<f32> = select(vec3<f32>(), vec3<f32>(), vec3<bool>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ebfea2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ebfea2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ebfea2();
+}
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl
new file mode 100644
index 0000000..7b83f92
--- /dev/null
+++ b/test/intrinsics/gen/select/ed8a15.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn select_ed8a15() {
+ var res: i32 = select(1, 1, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ed8a15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ed8a15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ed8a15();
+}
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl
new file mode 100644
index 0000000..4211aca
--- /dev/null
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+SKIP: FAILED
+
+
+fn select_ed8a15() {
+ var res : i32 = select(1, 1, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ed8a15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ed8a15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ed8a15();
+}
+
+Failed to generate: error: select not supported in HLSL backend yet
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl
new file mode 100644
index 0000000..18b9b3a
--- /dev/null
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void select_ed8a15() {
+ int res = select(1, 1, bool());
+}
+
+vertex void vertex_main() {
+ select_ed8a15();
+ return;
+}
+
+fragment void fragment_main() {
+ select_ed8a15();
+ return;
+}
+
+kernel void compute_main() {
+ select_ed8a15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm b/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm
new file mode 100644
index 0000000..23dfca3
--- /dev/null
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %select_ed8a15 "select_ed8a15"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %bool = OpTypeBool
+ %13 = OpConstantNull %bool
+%_ptr_Function_int = OpTypePointer Function %int
+ %16 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%select_ed8a15 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %16
+ %9 = OpSelect %int %int_1 %int_1 %13
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %select_ed8a15
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %select_ed8a15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %select_ed8a15
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected bool scalar or vector type as condition: Select
+ %9 = OpSelect %int %int_1 %int_1 %13
+
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl
new file mode 100644
index 0000000..a569ef0
--- /dev/null
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn select_ed8a15() {
+ var res : i32 = select(1, 1, bool());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ select_ed8a15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ select_ed8a15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ select_ed8a15();
+}
diff --git a/test/intrinsics/gen/sign/159665.wgsl b/test/intrinsics/gen/sign/159665.wgsl
new file mode 100644
index 0000000..49eb85b
--- /dev/null
+++ b/test/intrinsics/gen/sign/159665.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sign_159665() {
+ var res: vec3<f32> = sign(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_159665();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_159665();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_159665();
+}
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl
new file mode 100644
index 0000000..822f73c
--- /dev/null
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sign_159665() {
+ float3 res = sign(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sign_159665();
+ return;
+}
+
+void fragment_main() {
+ sign_159665();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sign_159665();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.msl b/test/intrinsics/gen/sign/159665.wgsl.expected.msl
new file mode 100644
index 0000000..143c028
--- /dev/null
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sign_159665() {
+ float3 res = sign(float3());
+}
+
+vertex void vertex_main() {
+ sign_159665();
+ return;
+}
+
+fragment void fragment_main() {
+ sign_159665();
+ return;
+}
+
+kernel void compute_main() {
+ sign_159665();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm
new file mode 100644
index 0000000..a14e870
--- /dev/null
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sign_159665 "sign_159665"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%sign_159665 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 FSign %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sign_159665
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sign_159665
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sign_159665
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl
new file mode 100644
index 0000000..2f7b9a9
--- /dev/null
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sign_159665() {
+ var res : vec3<f32> = sign(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_159665();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_159665();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_159665();
+}
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl
new file mode 100644
index 0000000..85ed595
--- /dev/null
+++ b/test/intrinsics/gen/sign/b8f634.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sign_b8f634() {
+ var res: vec4<f32> = sign(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_b8f634();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_b8f634();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_b8f634();
+}
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl
new file mode 100644
index 0000000..d8c0428
--- /dev/null
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sign_b8f634() {
+ float4 res = sign(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sign_b8f634();
+ return;
+}
+
+void fragment_main() {
+ sign_b8f634();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sign_b8f634();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl
new file mode 100644
index 0000000..d26088d
--- /dev/null
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sign_b8f634() {
+ float4 res = sign(float4());
+}
+
+vertex void vertex_main() {
+ sign_b8f634();
+ return;
+}
+
+fragment void fragment_main() {
+ sign_b8f634();
+ return;
+}
+
+kernel void compute_main() {
+ sign_b8f634();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a2d428
--- /dev/null
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sign_b8f634 "sign_b8f634"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%sign_b8f634 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 FSign %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sign_b8f634
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sign_b8f634
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sign_b8f634
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl
new file mode 100644
index 0000000..4e8e484
--- /dev/null
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sign_b8f634() {
+ var res : vec4<f32> = sign(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_b8f634();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_b8f634();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_b8f634();
+}
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl
new file mode 100644
index 0000000..75254a8
--- /dev/null
+++ b/test/intrinsics/gen/sign/d065d8.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sign_d065d8() {
+ var res: vec2<f32> = sign(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_d065d8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_d065d8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_d065d8();
+}
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl
new file mode 100644
index 0000000..491b380
--- /dev/null
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sign_d065d8() {
+ float2 res = sign(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sign_d065d8();
+ return;
+}
+
+void fragment_main() {
+ sign_d065d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sign_d065d8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl
new file mode 100644
index 0000000..abacffb
--- /dev/null
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sign_d065d8() {
+ float2 res = sign(float2());
+}
+
+vertex void vertex_main() {
+ sign_d065d8();
+ return;
+}
+
+fragment void fragment_main() {
+ sign_d065d8();
+ return;
+}
+
+kernel void compute_main() {
+ sign_d065d8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..f532736
--- /dev/null
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sign_d065d8 "sign_d065d8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%sign_d065d8 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 FSign %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sign_d065d8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sign_d065d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sign_d065d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..9079c7f
--- /dev/null
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sign_d065d8() {
+ var res : vec2<f32> = sign(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_d065d8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_d065d8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_d065d8();
+}
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl
new file mode 100644
index 0000000..762bdfe
--- /dev/null
+++ b/test/intrinsics/gen/sign/dd790e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sign_dd790e() {
+ var res: f32 = sign(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_dd790e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_dd790e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_dd790e();
+}
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl
new file mode 100644
index 0000000..52f319c
--- /dev/null
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sign_dd790e() {
+ float res = sign(1.0f);
+}
+
+void vertex_main() {
+ sign_dd790e();
+ return;
+}
+
+void fragment_main() {
+ sign_dd790e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sign_dd790e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl
new file mode 100644
index 0000000..a4d2552
--- /dev/null
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sign_dd790e() {
+ float res = sign(1.0f);
+}
+
+vertex void vertex_main() {
+ sign_dd790e();
+ return;
+}
+
+fragment void fragment_main() {
+ sign_dd790e();
+ return;
+}
+
+kernel void compute_main() {
+ sign_dd790e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm
new file mode 100644
index 0000000..5403ccb
--- /dev/null
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sign_dd790e "sign_dd790e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%sign_dd790e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 FSign %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %sign_dd790e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sign_dd790e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sign_dd790e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl
new file mode 100644
index 0000000..4ec9d23
--- /dev/null
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sign_dd790e() {
+ var res : f32 = sign(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sign_dd790e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sign_dd790e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sign_dd790e();
+}
diff --git a/test/intrinsics/gen/sin/01f241.wgsl b/test/intrinsics/gen/sin/01f241.wgsl
new file mode 100644
index 0000000..b53e8b8
--- /dev/null
+++ b/test/intrinsics/gen/sin/01f241.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sin_01f241() {
+ var res: vec3<f32> = sin(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_01f241();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_01f241();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_01f241();
+}
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl
new file mode 100644
index 0000000..05afedd
--- /dev/null
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sin_01f241() {
+ float3 res = sin(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sin_01f241();
+ return;
+}
+
+void fragment_main() {
+ sin_01f241();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_01f241();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl
new file mode 100644
index 0000000..22ef886
--- /dev/null
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_01f241() {
+ float3 res = sin(float3());
+}
+
+vertex void vertex_main() {
+ sin_01f241();
+ return;
+}
+
+fragment void fragment_main() {
+ sin_01f241();
+ return;
+}
+
+kernel void compute_main() {
+ sin_01f241();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm
new file mode 100644
index 0000000..e03940b
--- /dev/null
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sin_01f241 "sin_01f241"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %sin_01f241 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Sin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sin_01f241
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sin_01f241
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sin_01f241
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl
new file mode 100644
index 0000000..4717bb5
--- /dev/null
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sin_01f241() {
+ var res : vec3<f32> = sin(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_01f241();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_01f241();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_01f241();
+}
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl
new file mode 100644
index 0000000..c0282bc
--- /dev/null
+++ b/test/intrinsics/gen/sin/4e3979.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sin_4e3979() {
+ var res: vec4<f32> = sin(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_4e3979();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_4e3979();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_4e3979();
+}
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl
new file mode 100644
index 0000000..6ef2c93
--- /dev/null
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sin_4e3979() {
+ float4 res = sin(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sin_4e3979();
+ return;
+}
+
+void fragment_main() {
+ sin_4e3979();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_4e3979();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl
new file mode 100644
index 0000000..331a368
--- /dev/null
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_4e3979() {
+ float4 res = sin(float4());
+}
+
+vertex void vertex_main() {
+ sin_4e3979();
+ return;
+}
+
+fragment void fragment_main() {
+ sin_4e3979();
+ return;
+}
+
+kernel void compute_main() {
+ sin_4e3979();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm
new file mode 100644
index 0000000..af59f4a
--- /dev/null
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sin_4e3979 "sin_4e3979"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %sin_4e3979 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Sin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sin_4e3979
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sin_4e3979
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sin_4e3979
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl
new file mode 100644
index 0000000..ae9d145
--- /dev/null
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sin_4e3979() {
+ var res : vec4<f32> = sin(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_4e3979();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_4e3979();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_4e3979();
+}
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl
new file mode 100644
index 0000000..35cd7d9
--- /dev/null
+++ b/test/intrinsics/gen/sin/b78c91.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sin_b78c91() {
+ var res: f32 = sin(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_b78c91();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_b78c91();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_b78c91();
+}
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl
new file mode 100644
index 0000000..e3c066a
--- /dev/null
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sin_b78c91() {
+ float res = sin(1.0f);
+}
+
+void vertex_main() {
+ sin_b78c91();
+ return;
+}
+
+void fragment_main() {
+ sin_b78c91();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_b78c91();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl
new file mode 100644
index 0000000..ddada4c
--- /dev/null
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_b78c91() {
+ float res = sin(1.0f);
+}
+
+vertex void vertex_main() {
+ sin_b78c91();
+ return;
+}
+
+fragment void fragment_main() {
+ sin_b78c91();
+ return;
+}
+
+kernel void compute_main() {
+ sin_b78c91();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1ba48d
--- /dev/null
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sin_b78c91 "sin_b78c91"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %sin_b78c91 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Sin %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %sin_b78c91
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sin_b78c91
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_b78c91
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl
new file mode 100644
index 0000000..de3a1f3
--- /dev/null
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sin_b78c91() {
+ var res : f32 = sin(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_b78c91();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_b78c91();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_b78c91();
+}
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl
new file mode 100644
index 0000000..ea5e900
--- /dev/null
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sin_fc8bc4() {
+ var res: vec2<f32> = sin(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_fc8bc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_fc8bc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_fc8bc4();
+}
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl
new file mode 100644
index 0000000..e24e20e
--- /dev/null
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sin_fc8bc4() {
+ float2 res = sin(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sin_fc8bc4();
+ return;
+}
+
+void fragment_main() {
+ sin_fc8bc4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_fc8bc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl
new file mode 100644
index 0000000..0dbeea8
--- /dev/null
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_fc8bc4() {
+ float2 res = sin(float2());
+}
+
+vertex void vertex_main() {
+ sin_fc8bc4();
+ return;
+}
+
+fragment void fragment_main() {
+ sin_fc8bc4();
+ return;
+}
+
+kernel void compute_main() {
+ sin_fc8bc4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9a58ad
--- /dev/null
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sin_fc8bc4 "sin_fc8bc4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %sin_fc8bc4 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Sin %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sin_fc8bc4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sin_fc8bc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sin_fc8bc4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl
new file mode 100644
index 0000000..35ad28e
--- /dev/null
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sin_fc8bc4() {
+ var res : vec2<f32> = sin(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sin_fc8bc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sin_fc8bc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sin_fc8bc4();
+}
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl
new file mode 100644
index 0000000..0a62c81
--- /dev/null
+++ b/test/intrinsics/gen/sinh/445e33.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sinh_445e33() {
+ var res: vec4<f32> = sinh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_445e33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_445e33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_445e33();
+}
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl
new file mode 100644
index 0000000..b8cb85b
--- /dev/null
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sinh_445e33() {
+ float4 res = sinh(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sinh_445e33();
+ return;
+}
+
+void fragment_main() {
+ sinh_445e33();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_445e33();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl
new file mode 100644
index 0000000..0f89471
--- /dev/null
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_445e33() {
+ float4 res = sinh(float4());
+}
+
+vertex void vertex_main() {
+ sinh_445e33();
+ return;
+}
+
+fragment void fragment_main() {
+ sinh_445e33();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_445e33();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm
new file mode 100644
index 0000000..734a54b
--- /dev/null
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sinh_445e33 "sinh_445e33"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%sinh_445e33 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Sinh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sinh_445e33
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sinh_445e33
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sinh_445e33
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl
new file mode 100644
index 0000000..ad790a5
--- /dev/null
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sinh_445e33() {
+ var res : vec4<f32> = sinh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_445e33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_445e33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_445e33();
+}
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl
new file mode 100644
index 0000000..b38208c
--- /dev/null
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sinh_7bb598() {
+ var res: f32 = sinh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_7bb598();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_7bb598();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_7bb598();
+}
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl
new file mode 100644
index 0000000..181c064
--- /dev/null
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sinh_7bb598() {
+ float res = sinh(1.0f);
+}
+
+void vertex_main() {
+ sinh_7bb598();
+ return;
+}
+
+void fragment_main() {
+ sinh_7bb598();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_7bb598();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl
new file mode 100644
index 0000000..d14c1fb
--- /dev/null
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_7bb598() {
+ float res = sinh(1.0f);
+}
+
+vertex void vertex_main() {
+ sinh_7bb598();
+ return;
+}
+
+fragment void fragment_main() {
+ sinh_7bb598();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_7bb598();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm
new file mode 100644
index 0000000..481720d
--- /dev/null
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sinh_7bb598 "sinh_7bb598"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%sinh_7bb598 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Sinh %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %sinh_7bb598
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sinh_7bb598
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_7bb598
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl
new file mode 100644
index 0000000..ae2a45f
--- /dev/null
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sinh_7bb598() {
+ var res : f32 = sinh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_7bb598();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_7bb598();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_7bb598();
+}
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl
new file mode 100644
index 0000000..5f596f2
--- /dev/null
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sinh_b9860e() {
+ var res: vec2<f32> = sinh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_b9860e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_b9860e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_b9860e();
+}
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl
new file mode 100644
index 0000000..4c2cd68
--- /dev/null
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sinh_b9860e() {
+ float2 res = sinh(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sinh_b9860e();
+ return;
+}
+
+void fragment_main() {
+ sinh_b9860e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_b9860e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl
new file mode 100644
index 0000000..3f6dc50
--- /dev/null
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_b9860e() {
+ float2 res = sinh(float2());
+}
+
+vertex void vertex_main() {
+ sinh_b9860e();
+ return;
+}
+
+fragment void fragment_main() {
+ sinh_b9860e();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_b9860e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm
new file mode 100644
index 0000000..82b4486
--- /dev/null
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sinh_b9860e "sinh_b9860e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%sinh_b9860e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Sinh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sinh_b9860e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sinh_b9860e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sinh_b9860e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl
new file mode 100644
index 0000000..20bc6e3
--- /dev/null
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sinh_b9860e() {
+ var res : vec2<f32> = sinh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_b9860e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_b9860e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_b9860e();
+}
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl
new file mode 100644
index 0000000..0f60e63
--- /dev/null
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sinh_c9a5eb() {
+ var res: vec3<f32> = sinh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_c9a5eb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_c9a5eb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_c9a5eb();
+}
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl
new file mode 100644
index 0000000..b18f22e
--- /dev/null
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sinh_c9a5eb() {
+ float3 res = sinh(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sinh_c9a5eb();
+ return;
+}
+
+void fragment_main() {
+ sinh_c9a5eb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_c9a5eb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl
new file mode 100644
index 0000000..91ba6f6
--- /dev/null
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_c9a5eb() {
+ float3 res = sinh(float3());
+}
+
+vertex void vertex_main() {
+ sinh_c9a5eb();
+ return;
+}
+
+fragment void fragment_main() {
+ sinh_c9a5eb();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_c9a5eb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm
new file mode 100644
index 0000000..480ba1c
--- /dev/null
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sinh_c9a5eb "sinh_c9a5eb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%sinh_c9a5eb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Sinh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sinh_c9a5eb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sinh_c9a5eb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sinh_c9a5eb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl
new file mode 100644
index 0000000..7056b19
--- /dev/null
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sinh_c9a5eb() {
+ var res : vec3<f32> = sinh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sinh_c9a5eb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sinh_c9a5eb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sinh_c9a5eb();
+}
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl
new file mode 100644
index 0000000..c71fcf0
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn smoothStep_5f615b() {
+ var res: vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_5f615b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_5f615b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_5f615b();
+}
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl
new file mode 100644
index 0000000..49c6c61
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void smoothStep_5f615b() {
+ float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+void fragment_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_5f615b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl
new file mode 100644
index 0000000..3f21ed3
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_5f615b() {
+ float4 res = smoothstep(float4(), float4(), float4());
+}
+
+vertex void vertex_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+fragment void fragment_main() {
+ smoothStep_5f615b();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_5f615b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm
new file mode 100644
index 0000000..f2e6112
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %smoothStep_5f615b "smoothStep_5f615b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%smoothStep_5f615b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 SmoothStep %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl
new file mode 100644
index 0000000..26e95e4
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn smoothStep_5f615b() {
+ var res : vec4<f32> = smoothStep(vec4<f32>(), vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_5f615b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_5f615b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_5f615b();
+}
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl
new file mode 100644
index 0000000..c66c45f
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn smoothStep_658be3() {
+ var res: vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_658be3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_658be3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_658be3();
+}
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl
new file mode 100644
index 0000000..80b9c81
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void smoothStep_658be3() {
+ float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ smoothStep_658be3();
+ return;
+}
+
+void fragment_main() {
+ smoothStep_658be3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_658be3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl
new file mode 100644
index 0000000..dc7e7a4
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_658be3() {
+ float3 res = smoothstep(float3(), float3(), float3());
+}
+
+vertex void vertex_main() {
+ smoothStep_658be3();
+ return;
+}
+
+fragment void fragment_main() {
+ smoothStep_658be3();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_658be3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm
new file mode 100644
index 0000000..8278797
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %smoothStep_658be3 "smoothStep_658be3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%smoothStep_658be3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 SmoothStep %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %smoothStep_658be3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %smoothStep_658be3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %smoothStep_658be3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl
new file mode 100644
index 0000000..5a6bd89
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn smoothStep_658be3() {
+ var res : vec3<f32> = smoothStep(vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_658be3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_658be3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_658be3();
+}
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl
new file mode 100644
index 0000000..1f531a2
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn smoothStep_c11eef() {
+ var res: vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_c11eef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_c11eef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_c11eef();
+}
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl
new file mode 100644
index 0000000..bda9151
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void smoothStep_c11eef() {
+ float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+void fragment_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_c11eef();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl
new file mode 100644
index 0000000..3f3315d
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_c11eef() {
+ float2 res = smoothstep(float2(), float2(), float2());
+}
+
+vertex void vertex_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+fragment void fragment_main() {
+ smoothStep_c11eef();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_c11eef();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d21a96
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %smoothStep_c11eef "smoothStep_c11eef"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%smoothStep_c11eef = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 SmoothStep %12 %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %smoothStep_c11eef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl
new file mode 100644
index 0000000..147b9fd
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn smoothStep_c11eef() {
+ var res : vec2<f32> = smoothStep(vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_c11eef();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_c11eef();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_c11eef();
+}
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl
new file mode 100644
index 0000000..e67b070
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn smoothStep_cb0bfb() {
+ var res: f32 = smoothStep(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_cb0bfb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_cb0bfb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_cb0bfb();
+}
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl
new file mode 100644
index 0000000..7f9a93d
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+void vertex_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+void fragment_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl
new file mode 100644
index 0000000..9e0b99a
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void smoothStep_cb0bfb() {
+ float res = smoothstep(1.0f, 1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+fragment void fragment_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
+kernel void compute_main() {
+ smoothStep_cb0bfb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm
new file mode 100644
index 0000000..e991a8c
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %smoothStep_cb0bfb "smoothStep_cb0bfb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%smoothStep_cb0bfb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 SmoothStep %float_1 %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl
new file mode 100644
index 0000000..7ecfe0c
--- /dev/null
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn smoothStep_cb0bfb() {
+ var res : f32 = smoothStep(1.0, 1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ smoothStep_cb0bfb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ smoothStep_cb0bfb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ smoothStep_cb0bfb();
+}
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl
new file mode 100644
index 0000000..7a74f52
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sqrt_20c74e() {
+ var res: f32 = sqrt(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_20c74e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_20c74e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_20c74e();
+}
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl
new file mode 100644
index 0000000..d9fdd42
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sqrt_20c74e() {
+ float res = sqrt(1.0f);
+}
+
+void vertex_main() {
+ sqrt_20c74e();
+ return;
+}
+
+void fragment_main() {
+ sqrt_20c74e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sqrt_20c74e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl
new file mode 100644
index 0000000..591cff9
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sqrt_20c74e() {
+ float res = sqrt(1.0f);
+}
+
+vertex void vertex_main() {
+ sqrt_20c74e();
+ return;
+}
+
+fragment void fragment_main() {
+ sqrt_20c74e();
+ return;
+}
+
+kernel void compute_main() {
+ sqrt_20c74e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm
new file mode 100644
index 0000000..fefbb94
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sqrt_20c74e "sqrt_20c74e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%sqrt_20c74e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Sqrt %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %sqrt_20c74e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sqrt_20c74e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sqrt_20c74e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl
new file mode 100644
index 0000000..4aeac64
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sqrt_20c74e() {
+ var res : f32 = sqrt(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_20c74e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_20c74e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_20c74e();
+}
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl
new file mode 100644
index 0000000..9286ae3
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sqrt_8c7024() {
+ var res: vec2<f32> = sqrt(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_8c7024();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_8c7024();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_8c7024();
+}
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl
new file mode 100644
index 0000000..2e82392
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sqrt_8c7024() {
+ float2 res = sqrt(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sqrt_8c7024();
+ return;
+}
+
+void fragment_main() {
+ sqrt_8c7024();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sqrt_8c7024();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl
new file mode 100644
index 0000000..b2852ff
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sqrt_8c7024() {
+ float2 res = sqrt(float2());
+}
+
+vertex void vertex_main() {
+ sqrt_8c7024();
+ return;
+}
+
+fragment void fragment_main() {
+ sqrt_8c7024();
+ return;
+}
+
+kernel void compute_main() {
+ sqrt_8c7024();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm
new file mode 100644
index 0000000..ba243fc
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sqrt_8c7024 "sqrt_8c7024"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%sqrt_8c7024 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Sqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sqrt_8c7024
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sqrt_8c7024
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sqrt_8c7024
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl
new file mode 100644
index 0000000..6b97f1e
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sqrt_8c7024() {
+ var res : vec2<f32> = sqrt(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_8c7024();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_8c7024();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_8c7024();
+}
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl
new file mode 100644
index 0000000..d559779
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sqrt_aa0d7a() {
+ var res: vec4<f32> = sqrt(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_aa0d7a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_aa0d7a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_aa0d7a();
+}
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl
new file mode 100644
index 0000000..bc21867
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sqrt_aa0d7a() {
+ float4 res = sqrt(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
+void fragment_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl
new file mode 100644
index 0000000..9dbff0e
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sqrt_aa0d7a() {
+ float4 res = sqrt(float4());
+}
+
+vertex void vertex_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
+fragment void fragment_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
+kernel void compute_main() {
+ sqrt_aa0d7a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm
new file mode 100644
index 0000000..0a422cc
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sqrt_aa0d7a "sqrt_aa0d7a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%sqrt_aa0d7a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Sqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sqrt_aa0d7a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sqrt_aa0d7a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sqrt_aa0d7a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl
new file mode 100644
index 0000000..3785674
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sqrt_aa0d7a() {
+ var res : vec4<f32> = sqrt(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_aa0d7a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_aa0d7a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_aa0d7a();
+}
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl
new file mode 100644
index 0000000..ab11967
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn sqrt_f8c59a() {
+ var res: vec3<f32> = sqrt(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_f8c59a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_f8c59a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_f8c59a();
+}
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl
new file mode 100644
index 0000000..1dd2bc3
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void sqrt_f8c59a() {
+ float3 res = sqrt(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ sqrt_f8c59a();
+ return;
+}
+
+void fragment_main() {
+ sqrt_f8c59a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sqrt_f8c59a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl
new file mode 100644
index 0000000..9cb74e6
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sqrt_f8c59a() {
+ float3 res = sqrt(float3());
+}
+
+vertex void vertex_main() {
+ sqrt_f8c59a();
+ return;
+}
+
+fragment void fragment_main() {
+ sqrt_f8c59a();
+ return;
+}
+
+kernel void compute_main() {
+ sqrt_f8c59a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm
new file mode 100644
index 0000000..c29897a
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %sqrt_f8c59a "sqrt_f8c59a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%sqrt_f8c59a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Sqrt %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %sqrt_f8c59a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sqrt_f8c59a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %sqrt_f8c59a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a3adbe
--- /dev/null
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn sqrt_f8c59a() {
+ var res : vec3<f32> = sqrt(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ sqrt_f8c59a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ sqrt_f8c59a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ sqrt_f8c59a();
+}
diff --git a/test/intrinsics/gen/step/0b073b.wgsl b/test/intrinsics/gen/step/0b073b.wgsl
new file mode 100644
index 0000000..8efda60
--- /dev/null
+++ b/test/intrinsics/gen/step/0b073b.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn step_0b073b() {
+ var res: f32 = step(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_0b073b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_0b073b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_0b073b();
+}
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl
new file mode 100644
index 0000000..4aa8a03
--- /dev/null
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void step_0b073b() {
+ float res = step(1.0f, 1.0f);
+}
+
+void vertex_main() {
+ step_0b073b();
+ return;
+}
+
+void fragment_main() {
+ step_0b073b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ step_0b073b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl
new file mode 100644
index 0000000..379623d
--- /dev/null
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_0b073b() {
+ float res = step(1.0f, 1.0f);
+}
+
+vertex void vertex_main() {
+ step_0b073b();
+ return;
+}
+
+fragment void fragment_main() {
+ step_0b073b();
+ return;
+}
+
+kernel void compute_main() {
+ step_0b073b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm
new file mode 100644
index 0000000..733e788
--- /dev/null
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %step_0b073b "step_0b073b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%step_0b073b = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Step %float_1 %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %step_0b073b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %step_0b073b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %step_0b073b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c75b485
--- /dev/null
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn step_0b073b() {
+ var res : f32 = step(1.0, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_0b073b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_0b073b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_0b073b();
+}
diff --git a/test/intrinsics/gen/step/19accd.wgsl b/test/intrinsics/gen/step/19accd.wgsl
new file mode 100644
index 0000000..faebe4e
--- /dev/null
+++ b/test/intrinsics/gen/step/19accd.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn step_19accd() {
+ var res: vec2<f32> = step(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_19accd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_19accd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_19accd();
+}
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl
new file mode 100644
index 0000000..7dd6205
--- /dev/null
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void step_19accd() {
+ float2 res = step(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ step_19accd();
+ return;
+}
+
+void fragment_main() {
+ step_19accd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ step_19accd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.msl b/test/intrinsics/gen/step/19accd.wgsl.expected.msl
new file mode 100644
index 0000000..781b56a
--- /dev/null
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_19accd() {
+ float2 res = step(float2(), float2());
+}
+
+vertex void vertex_main() {
+ step_19accd();
+ return;
+}
+
+fragment void fragment_main() {
+ step_19accd();
+ return;
+}
+
+kernel void compute_main() {
+ step_19accd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm
new file mode 100644
index 0000000..93706b0
--- /dev/null
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %step_19accd "step_19accd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%step_19accd = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Step %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %step_19accd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %step_19accd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %step_19accd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl
new file mode 100644
index 0000000..e45f4ee
--- /dev/null
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn step_19accd() {
+ var res : vec2<f32> = step(vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_19accd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_19accd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_19accd();
+}
diff --git a/test/intrinsics/gen/step/334303.wgsl b/test/intrinsics/gen/step/334303.wgsl
new file mode 100644
index 0000000..e692357
--- /dev/null
+++ b/test/intrinsics/gen/step/334303.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn step_334303() {
+ var res: vec3<f32> = step(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_334303();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_334303();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_334303();
+}
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl
new file mode 100644
index 0000000..ee296d2
--- /dev/null
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void step_334303() {
+ float3 res = step(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ step_334303();
+ return;
+}
+
+void fragment_main() {
+ step_334303();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ step_334303();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.msl b/test/intrinsics/gen/step/334303.wgsl.expected.msl
new file mode 100644
index 0000000..cc53896
--- /dev/null
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_334303() {
+ float3 res = step(float3(), float3());
+}
+
+vertex void vertex_main() {
+ step_334303();
+ return;
+}
+
+fragment void fragment_main() {
+ step_334303();
+ return;
+}
+
+kernel void compute_main() {
+ step_334303();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm
new file mode 100644
index 0000000..6d91105
--- /dev/null
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %step_334303 "step_334303"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%step_334303 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Step %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %step_334303
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %step_334303
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %step_334303
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl
new file mode 100644
index 0000000..d14ad04
--- /dev/null
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn step_334303() {
+ var res : vec3<f32> = step(vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_334303();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_334303();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_334303();
+}
diff --git a/test/intrinsics/gen/step/e2b337.wgsl b/test/intrinsics/gen/step/e2b337.wgsl
new file mode 100644
index 0000000..8e11a80
--- /dev/null
+++ b/test/intrinsics/gen/step/e2b337.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn step_e2b337() {
+ var res: vec4<f32> = step(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_e2b337();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_e2b337();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_e2b337();
+}
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl
new file mode 100644
index 0000000..27f9644
--- /dev/null
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void step_e2b337() {
+ float4 res = step(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ step_e2b337();
+ return;
+}
+
+void fragment_main() {
+ step_e2b337();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ step_e2b337();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl
new file mode 100644
index 0000000..a59fbfe
--- /dev/null
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void step_e2b337() {
+ float4 res = step(float4(), float4());
+}
+
+vertex void vertex_main() {
+ step_e2b337();
+ return;
+}
+
+fragment void fragment_main() {
+ step_e2b337();
+ return;
+}
+
+kernel void compute_main() {
+ step_e2b337();
+ return;
+}
+
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm
new file mode 100644
index 0000000..5221bea
--- /dev/null
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %step_e2b337 "step_e2b337"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%step_e2b337 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Step %12 %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %step_e2b337
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %step_e2b337
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %step_e2b337
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl
new file mode 100644
index 0000000..2309dbf
--- /dev/null
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn step_e2b337() {
+ var res : vec4<f32> = step(vec4<f32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ step_e2b337();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ step_e2b337();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ step_e2b337();
+}
diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl
new file mode 100644
index 0000000..9011255
--- /dev/null
+++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn storageBarrier_d87211() {
+ storageBarrier();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ storageBarrier_d87211();
+}
diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl
new file mode 100644
index 0000000..1f80dfc
--- /dev/null
+++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl
@@ -0,0 +1,10 @@
+void storageBarrier_d87211() {
+ DeviceMemoryBarrierWithGroupSync();
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ storageBarrier_d87211();
+ return;
+}
+
diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl
new file mode 100644
index 0000000..daafd40
--- /dev/null
+++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void storageBarrier_d87211() {
+ threadgroup_barrier(mem_flags::mem_device);
+}
+
+kernel void compute_main() {
+ storageBarrier_d87211();
+ return;
+}
+
diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8fa6e9
--- /dev/null
+++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm
@@ -0,0 +1,27 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 13
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %storageBarrier_d87211 "storageBarrier_d87211"
+ OpName %compute_main "compute_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_1 = OpConstant %uint 1
+ %uint_72 = OpConstant %uint 72
+%storageBarrier_d87211 = OpFunction %void None %1
+ %4 = OpLabel
+ OpControlBarrier %uint_2 %uint_1 %uint_72
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %1
+ %11 = OpLabel
+ %12 = OpFunctionCall %void %storageBarrier_d87211
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ca8e84
--- /dev/null
+++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn storageBarrier_d87211() {
+ storageBarrier();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ storageBarrier_d87211();
+}
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl
new file mode 100644
index 0000000..7bb14bf
--- /dev/null
+++ b/test/intrinsics/gen/tan/244e2a.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tan_244e2a() {
+ var res: vec4<f32> = tan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_244e2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_244e2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_244e2a();
+}
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl
new file mode 100644
index 0000000..5044add
--- /dev/null
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tan_244e2a() {
+ float4 res = tan(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tan_244e2a();
+ return;
+}
+
+void fragment_main() {
+ tan_244e2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tan_244e2a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl
new file mode 100644
index 0000000..1f3a31d
--- /dev/null
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tan_244e2a() {
+ float4 res = tan(float4());
+}
+
+vertex void vertex_main() {
+ tan_244e2a();
+ return;
+}
+
+fragment void fragment_main() {
+ tan_244e2a();
+ return;
+}
+
+kernel void compute_main() {
+ tan_244e2a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..4ad2729
--- /dev/null
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tan_244e2a "tan_244e2a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+ %tan_244e2a = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Tan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tan_244e2a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tan_244e2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tan_244e2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..56c1b2d
--- /dev/null
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tan_244e2a() {
+ var res : vec4<f32> = tan(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_244e2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_244e2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_244e2a();
+}
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl
new file mode 100644
index 0000000..f0e4258
--- /dev/null
+++ b/test/intrinsics/gen/tan/2f030e.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tan_2f030e() {
+ var res: f32 = tan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_2f030e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_2f030e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_2f030e();
+}
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl
new file mode 100644
index 0000000..b647df2
--- /dev/null
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tan_2f030e() {
+ float res = tan(1.0f);
+}
+
+void vertex_main() {
+ tan_2f030e();
+ return;
+}
+
+void fragment_main() {
+ tan_2f030e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tan_2f030e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl
new file mode 100644
index 0000000..19a8b8f
--- /dev/null
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tan_2f030e() {
+ float res = tan(1.0f);
+}
+
+vertex void vertex_main() {
+ tan_2f030e();
+ return;
+}
+
+fragment void fragment_main() {
+ tan_2f030e();
+ return;
+}
+
+kernel void compute_main() {
+ tan_2f030e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm
new file mode 100644
index 0000000..ba5b2ce
--- /dev/null
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tan_2f030e "tan_2f030e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %tan_2f030e = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Tan %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %tan_2f030e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %tan_2f030e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %tan_2f030e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl
new file mode 100644
index 0000000..da88b0d
--- /dev/null
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tan_2f030e() {
+ var res : f32 = tan(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_2f030e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_2f030e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_2f030e();
+}
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl
new file mode 100644
index 0000000..c01ac62
--- /dev/null
+++ b/test/intrinsics/gen/tan/7ea104.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tan_7ea104() {
+ var res: vec3<f32> = tan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_7ea104();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_7ea104();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_7ea104();
+}
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl
new file mode 100644
index 0000000..f31a310
--- /dev/null
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tan_7ea104() {
+ float3 res = tan(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tan_7ea104();
+ return;
+}
+
+void fragment_main() {
+ tan_7ea104();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tan_7ea104();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl
new file mode 100644
index 0000000..17676af
--- /dev/null
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tan_7ea104() {
+ float3 res = tan(float3());
+}
+
+vertex void vertex_main() {
+ tan_7ea104();
+ return;
+}
+
+fragment void fragment_main() {
+ tan_7ea104();
+ return;
+}
+
+kernel void compute_main() {
+ tan_7ea104();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm
new file mode 100644
index 0000000..226a7b0
--- /dev/null
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tan_7ea104 "tan_7ea104"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+ %tan_7ea104 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Tan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tan_7ea104
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tan_7ea104
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tan_7ea104
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl
new file mode 100644
index 0000000..4e6f0f5
--- /dev/null
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tan_7ea104() {
+ var res : vec3<f32> = tan(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_7ea104();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_7ea104();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_7ea104();
+}
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl
new file mode 100644
index 0000000..b62fa47
--- /dev/null
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tan_8ce3e9() {
+ var res: vec2<f32> = tan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_8ce3e9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_8ce3e9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_8ce3e9();
+}
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl
new file mode 100644
index 0000000..ab79f9a
--- /dev/null
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tan_8ce3e9() {
+ float2 res = tan(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tan_8ce3e9();
+ return;
+}
+
+void fragment_main() {
+ tan_8ce3e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tan_8ce3e9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl
new file mode 100644
index 0000000..bad2f53
--- /dev/null
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tan_8ce3e9() {
+ float2 res = tan(float2());
+}
+
+vertex void vertex_main() {
+ tan_8ce3e9();
+ return;
+}
+
+fragment void fragment_main() {
+ tan_8ce3e9();
+ return;
+}
+
+kernel void compute_main() {
+ tan_8ce3e9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm
new file mode 100644
index 0000000..d02318d
--- /dev/null
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tan_8ce3e9 "tan_8ce3e9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+ %tan_8ce3e9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Tan %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tan_8ce3e9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tan_8ce3e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tan_8ce3e9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl
new file mode 100644
index 0000000..b7b3c29
--- /dev/null
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tan_8ce3e9() {
+ var res : vec2<f32> = tan(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tan_8ce3e9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tan_8ce3e9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tan_8ce3e9();
+}
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl
new file mode 100644
index 0000000..58def07
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tanh_5663c5() {
+ var res: vec4<f32> = tanh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_5663c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_5663c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_5663c5();
+}
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl
new file mode 100644
index 0000000..6a10df2
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tanh_5663c5() {
+ float4 res = tanh(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tanh_5663c5();
+ return;
+}
+
+void fragment_main() {
+ tanh_5663c5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tanh_5663c5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl
new file mode 100644
index 0000000..326f847
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tanh_5663c5() {
+ float4 res = tanh(float4());
+}
+
+vertex void vertex_main() {
+ tanh_5663c5();
+ return;
+}
+
+fragment void fragment_main() {
+ tanh_5663c5();
+ return;
+}
+
+kernel void compute_main() {
+ tanh_5663c5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6484100
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tanh_5663c5 "tanh_5663c5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%tanh_5663c5 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Tanh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tanh_5663c5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tanh_5663c5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tanh_5663c5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl
new file mode 100644
index 0000000..017fdaa
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tanh_5663c5() {
+ var res : vec4<f32> = tanh(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_5663c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_5663c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_5663c5();
+}
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl
new file mode 100644
index 0000000..e832a46
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tanh_5724b3() {
+ var res: vec2<f32> = tanh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_5724b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_5724b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_5724b3();
+}
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl
new file mode 100644
index 0000000..09ee1c5
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tanh_5724b3() {
+ float2 res = tanh(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tanh_5724b3();
+ return;
+}
+
+void fragment_main() {
+ tanh_5724b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tanh_5724b3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl
new file mode 100644
index 0000000..d87dbf7
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tanh_5724b3() {
+ float2 res = tanh(float2());
+}
+
+vertex void vertex_main() {
+ tanh_5724b3();
+ return;
+}
+
+fragment void fragment_main() {
+ tanh_5724b3();
+ return;
+}
+
+kernel void compute_main() {
+ tanh_5724b3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..573f7ef
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tanh_5724b3 "tanh_5724b3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%tanh_5724b3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Tanh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tanh_5724b3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tanh_5724b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tanh_5724b3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..64efc2b
--- /dev/null
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tanh_5724b3() {
+ var res : vec2<f32> = tanh(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_5724b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_5724b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_5724b3();
+}
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl
new file mode 100644
index 0000000..5461f60
--- /dev/null
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tanh_9f9fb9() {
+ var res: vec3<f32> = tanh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_9f9fb9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_9f9fb9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_9f9fb9();
+}
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl
new file mode 100644
index 0000000..981877b
--- /dev/null
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tanh_9f9fb9() {
+ float3 res = tanh(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ tanh_9f9fb9();
+ return;
+}
+
+void fragment_main() {
+ tanh_9f9fb9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tanh_9f9fb9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl
new file mode 100644
index 0000000..2eac415
--- /dev/null
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tanh_9f9fb9() {
+ float3 res = tanh(float3());
+}
+
+vertex void vertex_main() {
+ tanh_9f9fb9();
+ return;
+}
+
+fragment void fragment_main() {
+ tanh_9f9fb9();
+ return;
+}
+
+kernel void compute_main() {
+ tanh_9f9fb9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm
new file mode 100644
index 0000000..3f448b6
--- /dev/null
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tanh_9f9fb9 "tanh_9f9fb9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%tanh_9f9fb9 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Tanh %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %tanh_9f9fb9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %tanh_9f9fb9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %tanh_9f9fb9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff29472
--- /dev/null
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tanh_9f9fb9() {
+ var res : vec3<f32> = tanh(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_9f9fb9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_9f9fb9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_9f9fb9();
+}
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl
new file mode 100644
index 0000000..55d3294
--- /dev/null
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn tanh_c15fdb() {
+ var res: f32 = tanh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_c15fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_c15fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_c15fdb();
+}
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl
new file mode 100644
index 0000000..8638935
--- /dev/null
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void tanh_c15fdb() {
+ float res = tanh(1.0f);
+}
+
+void vertex_main() {
+ tanh_c15fdb();
+ return;
+}
+
+void fragment_main() {
+ tanh_c15fdb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ tanh_c15fdb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl
new file mode 100644
index 0000000..ca7aebe
--- /dev/null
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void tanh_c15fdb() {
+ float res = tanh(1.0f);
+}
+
+vertex void vertex_main() {
+ tanh_c15fdb();
+ return;
+}
+
+fragment void fragment_main() {
+ tanh_c15fdb();
+ return;
+}
+
+kernel void compute_main() {
+ tanh_c15fdb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm
new file mode 100644
index 0000000..250c6b2
--- /dev/null
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %tanh_c15fdb "tanh_c15fdb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%tanh_c15fdb = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Tanh %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %tanh_c15fdb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %tanh_c15fdb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %tanh_c15fdb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl
new file mode 100644
index 0000000..ecd8766
--- /dev/null
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn tanh_c15fdb() {
+ var res : f32 = tanh(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ tanh_c15fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ tanh_c15fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ tanh_c15fdb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl
new file mode 100644
index 0000000..718b2a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<f32>;
+fn textureDimensions_002b2a() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_002b2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_002b2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_002b2a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl
new file mode 100644
index 0000000..d83530e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_002b2a() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.msl
new file mode 100644
index 0000000..736870d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_002b2a() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_002b2a();
+ return;
+}
+
+
+tint_YrBvi5.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..2dc45cf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_002b2a "textureDimensions_002b2a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_002b2a = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %int %14 %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_002b2a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_002b2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_002b2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..20d2b0f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_002b2a() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_002b2a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_002b2a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_002b2a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl
new file mode 100644
index 0000000..69ae40d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, write>;
+fn textureDimensions_012b82() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_012b82();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_012b82();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_012b82();
+}
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl
new file mode 100644
index 0000000..a192aa3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_012b82() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_012b82();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_012b82();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_012b82();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.msl
new file mode 100644
index 0000000..701bdde
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_012b82() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_012b82();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_012b82();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_012b82();
+ return;
+}
+
+
+tint_53mrsD.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_53mrsD.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm
new file mode 100644
index 0000000..c8b4b79
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_012b82 "textureDimensions_012b82"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_012b82 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_012b82
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_012b82
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_012b82
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl
new file mode 100644
index 0000000..7a5470d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32sint>;
+
+fn textureDimensions_012b82() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_012b82();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_012b82();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_012b82();
+}
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl
new file mode 100644
index 0000000..ba9471b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16sint, write>;
+fn textureDimensions_08753d() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_08753d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_08753d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_08753d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl
new file mode 100644
index 0000000..e414fdb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_08753d() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_08753d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_08753d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_08753d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.msl
new file mode 100644
index 0000000..9747407
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_08753d() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_08753d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_08753d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_08753d();
+ return;
+}
+
+
+tint_UY6QJy.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm
new file mode 100644
index 0000000..9ab3e11
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_08753d "textureDimensions_08753d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_08753d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_08753d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_08753d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_08753d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl
new file mode 100644
index 0000000..dde9010
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16sint>;
+
+fn textureDimensions_08753d() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_08753d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_08753d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_08753d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl
new file mode 100644
index 0000000..6cf4810
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32sint, read>;
+fn textureDimensions_08a62e() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_08a62e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_08a62e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_08a62e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl
new file mode 100644
index 0000000..daea9af
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_08a62e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.msl
new file mode 100644
index 0000000..9091d77
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_08a62e() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_08a62e();
+ return;
+}
+
+
+tint_YCd6H7.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm
new file mode 100644
index 0000000..0eca5b3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_08a62e "textureDimensions_08a62e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_08a62e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_08a62e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_08a62e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_08a62e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl
new file mode 100644
index 0000000..fad47a1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32sint>;
+
+fn textureDimensions_08a62e() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_08a62e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_08a62e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_08a62e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl
new file mode 100644
index 0000000..2e4dc90
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, read>;
+fn textureDimensions_0a5fcf() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0a5fcf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0a5fcf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0a5fcf();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl
new file mode 100644
index 0000000..d269b48
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_0a5fcf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.msl
new file mode 100644
index 0000000..c47cacc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0a5fcf() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0a5fcf();
+ return;
+}
+
+
+tint_NfeUfx.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_NfeUfx.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm
new file mode 100644
index 0000000..7f18747
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0a5fcf "textureDimensions_0a5fcf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0a5fcf = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_0a5fcf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_0a5fcf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_0a5fcf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl
new file mode 100644
index 0000000..14574cf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16float>;
+
+fn textureDimensions_0a5fcf() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0a5fcf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0a5fcf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0a5fcf();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl
new file mode 100644
index 0000000..c74f80f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16sint, read>;
+fn textureDimensions_0bab57() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0bab57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0bab57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0bab57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl
new file mode 100644
index 0000000..74e27fc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_0bab57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.msl
new file mode 100644
index 0000000..26f279e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0bab57() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0bab57();
+ return;
+}
+
+
+tint_VmqGL7.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_VmqGL7.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_VmqGL7.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0652c2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0bab57 "textureDimensions_0bab57"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0bab57 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_0bab57
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_0bab57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_0bab57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl
new file mode 100644
index 0000000..3ba0ffc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16sint>;
+
+fn textureDimensions_0bab57() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0bab57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0bab57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0bab57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl
new file mode 100644
index 0000000..d880eba
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16float, write>;
+fn textureDimensions_0c4772() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0c4772();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0c4772();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0c4772();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl
new file mode 100644
index 0000000..6aa502f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0c4772() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.msl
new file mode 100644
index 0000000..2185536
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0c4772() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0c4772();
+ return;
+}
+
+
+tint_oTvIFp.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_oTvIFp.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_oTvIFp.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm
new file mode 100644
index 0000000..3c1c1c0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0c4772 "textureDimensions_0c4772"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0c4772 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_0c4772
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_0c4772
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_0c4772
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl
new file mode 100644
index 0000000..8721c37
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16float>;
+
+fn textureDimensions_0c4772() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0c4772();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0c4772();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0c4772();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl
new file mode 100644
index 0000000..8e54db4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32sint, write>;
+fn textureDimensions_0cce40() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0cce40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0cce40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0cce40();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl
new file mode 100644
index 0000000..7b1dcc7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_0cce40() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.msl
new file mode 100644
index 0000000..b771ab7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0cce40() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0cce40();
+ return;
+}
+
+
+tint_qF3vqW.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm
new file mode 100644
index 0000000..98ecb89
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0cce40 "textureDimensions_0cce40"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0cce40 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_0cce40
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_0cce40
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_0cce40
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl
new file mode 100644
index 0000000..fd78266
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32sint>;
+
+fn textureDimensions_0cce40() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0cce40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0cce40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0cce40();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl
new file mode 100644
index 0000000..4b75932
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16uint, write>;
+fn textureDimensions_0cf2ff() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0cf2ff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0cf2ff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0cf2ff();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl
new file mode 100644
index 0000000..738b5be
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_0cf2ff() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.msl
new file mode 100644
index 0000000..41747da
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0cf2ff() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0cf2ff();
+ return;
+}
+
+
+tint_qzu6tS.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_qzu6tS.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm
new file mode 100644
index 0000000..40c7109
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0cf2ff "textureDimensions_0cf2ff"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0cf2ff = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_0cf2ff
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_0cf2ff
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_0cf2ff
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl
new file mode 100644
index 0000000..21b0006
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16uint>;
+
+fn textureDimensions_0cf2ff() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0cf2ff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0cf2ff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0cf2ff();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl
new file mode 100644
index 0000000..0946237
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, write>;
+fn textureDimensions_0d8b7e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0d8b7e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0d8b7e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0d8b7e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl
new file mode 100644
index 0000000..06bf872
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_0d8b7e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.msl
new file mode 100644
index 0000000..50cf96a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0d8b7e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0d8b7e();
+ return;
+}
+
+
+tint_F95BY3.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_F95BY3.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm
new file mode 100644
index 0000000..e8b582b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0d8b7e "textureDimensions_0d8b7e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0d8b7e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_0d8b7e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_0d8b7e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_0d8b7e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0c36bf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32uint>;
+
+fn textureDimensions_0d8b7e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0d8b7e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0d8b7e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0d8b7e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl
new file mode 100644
index 0000000..a242d8e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16uint, write>;
+fn textureDimensions_0e32ee() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0e32ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0e32ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0e32ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl
new file mode 100644
index 0000000..7146aa7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_0e32ee() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.msl
new file mode 100644
index 0000000..ba2297d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0e32ee() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0e32ee();
+ return;
+}
+
+
+tint_xjHPQ6.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xjHPQ6.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xjHPQ6.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm
new file mode 100644
index 0000000..c53b4b1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0e32ee "textureDimensions_0e32ee"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0e32ee = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_0e32ee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_0e32ee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_0e32ee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl
new file mode 100644
index 0000000..b32e2ea
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16uint>;
+
+fn textureDimensions_0e32ee() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0e32ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0e32ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0e32ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl
new file mode 100644
index 0000000..a2a7a52
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<i32>;
+fn textureDimensions_0f3c50() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0f3c50();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0f3c50();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0f3c50();
+}
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl
new file mode 100644
index 0000000..abf7390
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_0f3c50() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.msl
new file mode 100644
index 0000000..6c2793a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0f3c50() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_0f3c50();
+ return;
+}
+
+
+tint_UClgXx.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_UClgXx.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm
new file mode 100644
index 0000000..0091be2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0f3c50 "textureDimensions_0f3c50"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_0f3c50 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_0
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_0f3c50
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_0f3c50
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_0f3c50
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl
new file mode 100644
index 0000000..ce1a4f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_0f3c50() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_0f3c50();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_0f3c50();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_0f3c50();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl
new file mode 100644
index 0000000..a460387
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, read>;
+fn textureDimensions_1147d6() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1147d6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1147d6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1147d6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl
new file mode 100644
index 0000000..b1318e5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1147d6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.msl
new file mode 100644
index 0000000..37d8bdb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1147d6() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1147d6();
+ return;
+}
+
+
+tint_cYmRIw.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_cYmRIw.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm
new file mode 100644
index 0000000..7c586a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1147d6 "textureDimensions_1147d6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1147d6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_1147d6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1147d6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_1147d6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl
new file mode 100644
index 0000000..d510726
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureDimensions_1147d6() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1147d6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1147d6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1147d6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl
new file mode 100644
index 0000000..b846121
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<u32>;
+fn textureDimensions_1191a5() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1191a5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1191a5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1191a5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl
new file mode 100644
index 0000000..561d7d4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_1191a5() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.msl
new file mode 100644
index 0000000..c20ed0c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1191a5() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1191a5();
+ return;
+}
+
+
+tint_dHtSbR.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_dHtSbR.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm
new file mode 100644
index 0000000..c94df74
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1191a5 "textureDimensions_1191a5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1191a5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v2int %16 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_1191a5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1191a5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_1191a5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl
new file mode 100644
index 0000000..d17c8a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_1191a5() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1191a5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1191a5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1191a5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl
new file mode 100644
index 0000000..e99292b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+fn textureDimensions_12c9bb() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_12c9bb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_12c9bb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_12c9bb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl
new file mode 100644
index 0000000..e2fbea5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_12c9bb() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.msl
new file mode 100644
index 0000000..29197a2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_12c9bb() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_12c9bb();
+ return;
+}
+
+
+tint_jub3iU.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_jub3iU.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm
new file mode 100644
index 0000000..ff69832
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_12c9bb "textureDimensions_12c9bb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_12c9bb = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v2int %15 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_12c9bb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_12c9bb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_12c9bb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl
new file mode 100644
index 0000000..a9e20d6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+fn textureDimensions_12c9bb() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_12c9bb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_12c9bb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_12c9bb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl
new file mode 100644
index 0000000..f0dbaf2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32float, write>;
+fn textureDimensions_147998() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_147998();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_147998();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_147998();
+}
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl
new file mode 100644
index 0000000..eff5508
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_147998() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_147998();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_147998();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_147998();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.msl
new file mode 100644
index 0000000..b8a7f49
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_147998() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_147998();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_147998();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_147998();
+ return;
+}
+
+
+tint_XJHJFB.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_XJHJFB.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm
new file mode 100644
index 0000000..2295a19
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_147998 "textureDimensions_147998"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_147998 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_147998
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_147998
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_147998
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl
new file mode 100644
index 0000000..cc32bc4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32float>;
+
+fn textureDimensions_147998() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_147998();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_147998();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_147998();
+}
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl
new file mode 100644
index 0000000..55224db
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, write>;
+fn textureDimensions_16036c() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_16036c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_16036c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_16036c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl
new file mode 100644
index 0000000..f358c2a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_16036c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_16036c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_16036c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_16036c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.msl
new file mode 100644
index 0000000..3509672
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_16036c() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_16036c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_16036c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_16036c();
+ return;
+}
+
+
+tint_vxFz1a.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_vxFz1a.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm
new file mode 100644
index 0000000..8498e15
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_16036c "textureDimensions_16036c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_16036c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_16036c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_16036c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_16036c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl
new file mode 100644
index 0000000..3972668
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureDimensions_16036c() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_16036c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_16036c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_16036c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl
new file mode 100644
index 0000000..ae55f61
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8unorm, read>;
+fn textureDimensions_168fcc() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_168fcc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_168fcc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_168fcc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl
new file mode 100644
index 0000000..45811ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_168fcc() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.msl
new file mode 100644
index 0000000..77c4fea
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_168fcc() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_168fcc();
+ return;
+}
+
+
+tint_IK0v0a.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_IK0v0a.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9b2a43
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_168fcc "textureDimensions_168fcc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_168fcc = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_168fcc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_168fcc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_168fcc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl
new file mode 100644
index 0000000..50cebb3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
+
+fn textureDimensions_168fcc() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_168fcc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_168fcc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_168fcc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl
new file mode 100644
index 0000000..9579b95
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<u32>;
+fn textureDimensions_183b3e() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_183b3e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_183b3e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_183b3e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl
new file mode 100644
index 0000000..764248c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_183b3e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl
new file mode 100644
index 0000000..f613834
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_183b3e() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_183b3e();
+ return;
+}
+
+
+tint_k1bgdS.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_k1bgdS.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_k1bgdS.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a6eb22
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_183b3e "textureDimensions_183b3e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_183b3e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %17 %int_0
+ %13 = OpVectorShuffle %v3int %16 %16 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_183b3e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_183b3e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_183b3e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d2bc85f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_183b3e() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_183b3e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_183b3e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_183b3e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl
new file mode 100644
index 0000000..d458253
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, read>;
+fn textureDimensions_18bd57() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_18bd57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_18bd57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_18bd57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl
new file mode 100644
index 0000000..14127ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_18bd57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.msl
new file mode 100644
index 0000000..1e1ae1e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_18bd57() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_18bd57();
+ return;
+}
+
+
+tint_Maj4Vv.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_Maj4Vv.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm
new file mode 100644
index 0000000..70b169b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_18bd57 "textureDimensions_18bd57"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_18bd57 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_18bd57
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_18bd57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_18bd57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl
new file mode 100644
index 0000000..01698c5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32uint>;
+
+fn textureDimensions_18bd57() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_18bd57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_18bd57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_18bd57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl
new file mode 100644
index 0000000..21137dc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32sint, read>;
+fn textureDimensions_19bffc() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_19bffc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_19bffc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_19bffc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl
new file mode 100644
index 0000000..dbcc08d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_19bffc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.msl
new file mode 100644
index 0000000..d0cac34
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_19bffc() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_19bffc();
+ return;
+}
+
+
+tint_3gqqBY.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_3gqqBY.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_3gqqBY.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d81c19
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_19bffc "textureDimensions_19bffc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_19bffc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_19bffc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_19bffc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_19bffc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl
new file mode 100644
index 0000000..e0135b0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32sint>;
+
+fn textureDimensions_19bffc() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_19bffc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_19bffc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_19bffc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl
new file mode 100644
index 0000000..30f31ea
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, read>;
+fn textureDimensions_1a58e7() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1a58e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1a58e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1a58e7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..565d342
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1a58e7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.msl
new file mode 100644
index 0000000..80d0a72
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1a58e7() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1a58e7();
+ return;
+}
+
+
+tint_ErdWWi.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_ErdWWi.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..504d710
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1a58e7 "textureDimensions_1a58e7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1a58e7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_1a58e7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1a58e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_1a58e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..2706764
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureDimensions_1a58e7() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1a58e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1a58e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1a58e7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl
new file mode 100644
index 0000000..b39067c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, read>;
+fn textureDimensions_1aa199() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1aa199();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1aa199();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1aa199();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl
new file mode 100644
index 0000000..bd8d2e1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1aa199() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.msl
new file mode 100644
index 0000000..9f17d36
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1aa199() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1aa199();
+ return;
+}
+
+
+tint_6ZmaRP.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_6ZmaRP.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm
new file mode 100644
index 0000000..682bb78
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1aa199 "textureDimensions_1aa199"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1aa199 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_1aa199
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1aa199
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_1aa199
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl
new file mode 100644
index 0000000..e04a103
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureDimensions_1aa199() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1aa199();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1aa199();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1aa199();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl
new file mode 100644
index 0000000..396abe2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16sint, write>;
+fn textureDimensions_1b71f0() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1b71f0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1b71f0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1b71f0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl
new file mode 100644
index 0000000..af31554
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_1b71f0() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.msl
new file mode 100644
index 0000000..3cf91c4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1b71f0() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1b71f0();
+ return;
+}
+
+
+tint_Hgy8iM.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Hgy8iM.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Hgy8iM.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm
new file mode 100644
index 0000000..1a854e4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1b71f0 "textureDimensions_1b71f0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1b71f0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_1b71f0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_1b71f0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1b71f0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl
new file mode 100644
index 0000000..e9f02be
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16sint>;
+
+fn textureDimensions_1b71f0() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1b71f0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1b71f0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1b71f0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl
new file mode 100644
index 0000000..29be560
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+fn textureDimensions_1d6c26() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1d6c26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1d6c26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1d6c26();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl
new file mode 100644
index 0000000..a496442
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_1d6c26() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.msl
new file mode 100644
index 0000000..96b2fa1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1d6c26() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1d6c26();
+ return;
+}
+
+
+tint_sD3lxy.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_sD3lxy.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm
new file mode 100644
index 0000000..91f238a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1d6c26 "textureDimensions_1d6c26"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1d6c26 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_1d6c26
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1d6c26
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_1d6c26
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa33009
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureDimensions_1d6c26() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1d6c26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1d6c26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1d6c26();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl
new file mode 100644
index 0000000..2234eda
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32sint, read>;
+fn textureDimensions_1e189c() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1e189c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1e189c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1e189c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl
new file mode 100644
index 0000000..be9b5ff
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1e189c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.msl
new file mode 100644
index 0000000..d42dd47
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1e189c() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1e189c();
+ return;
+}
+
+
+tint_gyn8lu.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_gyn8lu.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_gyn8lu.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb6508a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1e189c "textureDimensions_1e189c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1e189c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_1e189c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_1e189c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1e189c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl
new file mode 100644
index 0000000..7959299
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32sint>;
+
+fn textureDimensions_1e189c() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1e189c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1e189c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1e189c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl
new file mode 100644
index 0000000..e109c3c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16float, write>;
+fn textureDimensions_1e9e39() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1e9e39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1e9e39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1e9e39();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl
new file mode 100644
index 0000000..a77efc4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_1e9e39() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.msl
new file mode 100644
index 0000000..a9f4a05
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1e9e39() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1e9e39();
+ return;
+}
+
+
+tint_woGJy5.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm
new file mode 100644
index 0000000..33b2772
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1e9e39 "textureDimensions_1e9e39"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1e9e39 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_1e9e39
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_1e9e39
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1e9e39
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl
new file mode 100644
index 0000000..7aee504
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16float>;
+
+fn textureDimensions_1e9e39() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1e9e39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1e9e39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1e9e39();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl
new file mode 100644
index 0000000..a1468f4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<u32>;
+fn textureDimensions_1ebd6a() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1ebd6a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1ebd6a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1ebd6a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl
new file mode 100644
index 0000000..8cd7608
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_1ebd6a() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl
new file mode 100644
index 0000000..95dc541
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1ebd6a() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1ebd6a();
+ return;
+}
+
+
+tint_OvApsq.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_OvApsq.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_OvApsq.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm
new file mode 100644
index 0000000..dd9af14
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1ebd6a "textureDimensions_1ebd6a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %22 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1ebd6a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %18 %int_0
+ %13 = OpVectorShuffle %v3int %16 %16 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureDimensions_1ebd6a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_1ebd6a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_1ebd6a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl
new file mode 100644
index 0000000..da5ca1c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_1ebd6a() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1ebd6a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1ebd6a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1ebd6a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl
new file mode 100644
index 0000000..333146a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<u32>;
+fn textureDimensions_1f20c5() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1f20c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1f20c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1f20c5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl
new file mode 100644
index 0000000..bc07afa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_1f20c5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.msl
new file mode 100644
index 0000000..cc39489
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1f20c5() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_1f20c5();
+ return;
+}
+
+
+tint_u7r45E.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_u7r45E.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm
new file mode 100644
index 0000000..c7c82c8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1f20c5 "textureDimensions_1f20c5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_1f20c5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %18 %int_0
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureDimensions_1f20c5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_1f20c5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_1f20c5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl
new file mode 100644
index 0000000..dce90c1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_1f20c5() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_1f20c5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_1f20c5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_1f20c5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl
new file mode 100644
index 0000000..053eab1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32float, read>;
+fn textureDimensions_214b7b() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_214b7b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_214b7b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_214b7b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl
new file mode 100644
index 0000000..e3c3205
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_214b7b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.msl
new file mode 100644
index 0000000..3ba81a2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_214b7b() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_214b7b();
+ return;
+}
+
+
+tint_mQY3pp.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm
new file mode 100644
index 0000000..19b3b6d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_214b7b "textureDimensions_214b7b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_214b7b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_214b7b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_214b7b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_214b7b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl
new file mode 100644
index 0000000..5a63062
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32float>;
+
+fn textureDimensions_214b7b() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_214b7b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_214b7b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_214b7b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl
new file mode 100644
index 0000000..042c0ed
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8sint, write>;
+fn textureDimensions_214dd4() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_214dd4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_214dd4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_214dd4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl
new file mode 100644
index 0000000..9a51609
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_214dd4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.msl
new file mode 100644
index 0000000..cf5792a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_214dd4() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_214dd4();
+ return;
+}
+
+
+tint_RuhGmN.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_RuhGmN.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_RuhGmN.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm
new file mode 100644
index 0000000..3db1b54
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_214dd4 "textureDimensions_214dd4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_214dd4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_214dd4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_214dd4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_214dd4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl
new file mode 100644
index 0000000..de7e3bb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8sint>;
+
+fn textureDimensions_214dd4() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_214dd4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_214dd4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_214dd4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl
new file mode 100644
index 0000000..83b5d07
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<u32>;
+fn textureDimensions_267788() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_267788();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_267788();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_267788();
+}
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl
new file mode 100644
index 0000000..aa6b355
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_267788() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_267788();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_267788();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_267788();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.msl
new file mode 100644
index 0000000..457b334
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_267788() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_267788();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_267788();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_267788();
+ return;
+}
+
+
+tint_t0FoEb.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_t0FoEb.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0154aa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_267788 "textureDimensions_267788"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_267788 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %18 %int_1
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureDimensions_267788
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_267788
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_267788
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl
new file mode 100644
index 0000000..177cdb2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_267788() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_267788();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_267788();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_267788();
+}
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl
new file mode 100644
index 0000000..445a6d2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+fn textureDimensions_26bdfa() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_26bdfa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_26bdfa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_26bdfa();
+}
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl
new file mode 100644
index 0000000..f6e82ab
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_26bdfa() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyz;
+}
+
+void vertex_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.msl
new file mode 100644
index 0000000..dbc0fde
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_26bdfa() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_26bdfa();
+ return;
+}
+
+
+tint_ZWMTxF.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_ZWMTxF.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_ZWMTxF.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm
new file mode 100644
index 0000000..80e6028
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_26bdfa "textureDimensions_26bdfa"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_26bdfa = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v3int %15 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_26bdfa
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_26bdfa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_26bdfa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl
new file mode 100644
index 0000000..10d89c3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_26bdfa() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_26bdfa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_26bdfa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_26bdfa();
+}
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl
new file mode 100644
index 0000000..e197ab2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, write>;
+fn textureDimensions_26ef6c() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_26ef6c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_26ef6c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_26ef6c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl
new file mode 100644
index 0000000..9e11e83
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_26ef6c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.msl
new file mode 100644
index 0000000..332afa3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_26ef6c() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_26ef6c();
+ return;
+}
+
+
+tint_AGQyA0.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_AGQyA0.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm
new file mode 100644
index 0000000..26609c2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_26ef6c "textureDimensions_26ef6c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_26ef6c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_26ef6c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_26ef6c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_26ef6c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl
new file mode 100644
index 0000000..ccf7e79
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureDimensions_26ef6c() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_26ef6c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_26ef6c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_26ef6c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl
new file mode 100644
index 0000000..e10201e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16sint, write>;
+fn textureDimensions_2ad087() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2ad087();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2ad087();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2ad087();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl
new file mode 100644
index 0000000..82c4e11
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_2ad087() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.msl
new file mode 100644
index 0000000..60571a7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2ad087() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2ad087();
+ return;
+}
+
+
+tint_wMnrXN.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_wMnrXN.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm
new file mode 100644
index 0000000..74f5e24
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2ad087 "textureDimensions_2ad087"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2ad087 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_2ad087
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_2ad087
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2ad087
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl
new file mode 100644
index 0000000..095ee44
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16sint>;
+
+fn textureDimensions_2ad087() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2ad087();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2ad087();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2ad087();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl
new file mode 100644
index 0000000..8a96df2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32uint, read>;
+fn textureDimensions_2d32ae() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2d32ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2d32ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2d32ae();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl
new file mode 100644
index 0000000..83d3b36
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_2d32ae() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.msl
new file mode 100644
index 0000000..a278b6c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2d32ae() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2d32ae();
+ return;
+}
+
+
+tint_mQ7t9w.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_mQ7t9w.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_mQ7t9w.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm
new file mode 100644
index 0000000..96c6b4c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2d32ae "textureDimensions_2d32ae"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2d32ae = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_2d32ae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_2d32ae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_2d32ae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl
new file mode 100644
index 0000000..61b01c9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32uint>;
+
+fn textureDimensions_2d32ae() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2d32ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2d32ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2d32ae();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl
new file mode 100644
index 0000000..fc5760d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8snorm, read>;
+fn textureDimensions_2e0662() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2e0662();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2e0662();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2e0662();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl
new file mode 100644
index 0000000..30d3b53
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2e0662() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.msl
new file mode 100644
index 0000000..4a03532
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2e0662() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2e0662();
+ return;
+}
+
+
+tint_kZyeWE.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_kZyeWE.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm
new file mode 100644
index 0000000..8b365da
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2e0662 "textureDimensions_2e0662"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2e0662 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_2e0662
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_2e0662
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2e0662
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl
new file mode 100644
index 0000000..39f4bbd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8snorm>;
+
+fn textureDimensions_2e0662() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2e0662();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2e0662();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2e0662();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl
new file mode 100644
index 0000000..88c2c9f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<u32>;
+fn textureDimensions_2efa05() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2efa05();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2efa05();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2efa05();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl
new file mode 100644
index 0000000..5175bdd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_2efa05() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyz;
+}
+
+void vertex_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.msl
new file mode 100644
index 0000000..38226ec
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2efa05() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2efa05();
+ return;
+}
+
+
+tint_27jxuk.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_27jxuk.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_27jxuk.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm
new file mode 100644
index 0000000..ecba548
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2efa05 "textureDimensions_2efa05"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2efa05 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v3int %16 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_2efa05
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_2efa05
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_2efa05
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl
new file mode 100644
index 0000000..02c2e5a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_2efa05() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2efa05();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2efa05();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2efa05();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl
new file mode 100644
index 0000000..cc718aa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32sint, write>;
+fn textureDimensions_2f289f() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2f289f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2f289f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2f289f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl
new file mode 100644
index 0000000..ee4cc4c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_2f289f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.msl
new file mode 100644
index 0000000..6aaf3be
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2f289f() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2f289f();
+ return;
+}
+
+
+tint_xxOVlF.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xxOVlF.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xxOVlF.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d2be75
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2f289f "textureDimensions_2f289f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2f289f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_2f289f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_2f289f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2f289f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl
new file mode 100644
index 0000000..cb95ece
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32sint>;
+
+fn textureDimensions_2f289f() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2f289f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2f289f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2f289f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl
new file mode 100644
index 0000000..dfa4db2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+fn textureDimensions_2fe1cc() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2fe1cc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2fe1cc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2fe1cc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl
new file mode 100644
index 0000000..a2d49c8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2fe1cc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.msl
new file mode 100644
index 0000000..1090ab7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2fe1cc() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_2fe1cc();
+ return;
+}
+
+
+tint_6Uwx6N.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_6Uwx6N.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm
new file mode 100644
index 0000000..76ece0d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2fe1cc "textureDimensions_2fe1cc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_2fe1cc = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v2int %15 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_2fe1cc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_2fe1cc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_2fe1cc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl
new file mode 100644
index 0000000..215ce6a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_2fe1cc() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_2fe1cc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_2fe1cc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_2fe1cc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl
new file mode 100644
index 0000000..29b4ad5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16uint, write>;
+fn textureDimensions_318ecc() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_318ecc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_318ecc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_318ecc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl
new file mode 100644
index 0000000..ad7854d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_318ecc() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.msl
new file mode 100644
index 0000000..55c6228
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_318ecc() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_318ecc();
+ return;
+}
+
+
+tint_G5ZUUJ.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm
new file mode 100644
index 0000000..9cd91c9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_318ecc "textureDimensions_318ecc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_318ecc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_318ecc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_318ecc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_318ecc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl
new file mode 100644
index 0000000..4332a63
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16uint>;
+
+fn textureDimensions_318ecc() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_318ecc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_318ecc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_318ecc();
+}
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl
new file mode 100644
index 0000000..7d8e7ba
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32uint, write>;
+fn textureDimensions_340d06() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_340d06();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_340d06();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_340d06();
+}
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl
new file mode 100644
index 0000000..341d62a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_340d06() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_340d06();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_340d06();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_340d06();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.msl
new file mode 100644
index 0000000..3b0ea88
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_340d06() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_340d06();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_340d06();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_340d06();
+ return;
+}
+
+
+tint_E6aL0a.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_E6aL0a.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_E6aL0a.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ededab
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_340d06 "textureDimensions_340d06"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_340d06 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_340d06
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_340d06
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_340d06
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl
new file mode 100644
index 0000000..aca58ad
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32uint>;
+
+fn textureDimensions_340d06() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_340d06();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_340d06();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_340d06();
+}
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl
new file mode 100644
index 0000000..a6f3ad9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, write>;
+fn textureDimensions_398e30() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_398e30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_398e30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_398e30();
+}
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl
new file mode 100644
index 0000000..43f9e21
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_398e30() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_398e30();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_398e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_398e30();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.msl
new file mode 100644
index 0000000..d19328e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_398e30() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_398e30();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_398e30();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_398e30();
+ return;
+}
+
+
+tint_QcQpUI.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_QcQpUI.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm
new file mode 100644
index 0000000..d2c4d31
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_398e30 "textureDimensions_398e30"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_398e30 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_398e30
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_398e30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_398e30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl
new file mode 100644
index 0000000..50376ff
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureDimensions_398e30() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_398e30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_398e30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_398e30();
+}
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl
new file mode 100644
index 0000000..a06623f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, read>;
+fn textureDimensions_39a600() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_39a600();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_39a600();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_39a600();
+}
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl
new file mode 100644
index 0000000..bb63468
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_39a600() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_39a600();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_39a600();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_39a600();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.msl
new file mode 100644
index 0000000..585dd48
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_39a600() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_39a600();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_39a600();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_39a600();
+ return;
+}
+
+
+tint_IGrYE5.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_IGrYE5.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm
new file mode 100644
index 0000000..b5f190c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_39a600 "textureDimensions_39a600"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_39a600 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_39a600
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_39a600
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_39a600
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl
new file mode 100644
index 0000000..5915c37
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32sint>;
+
+fn textureDimensions_39a600() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_39a600();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_39a600();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_39a600();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl
new file mode 100644
index 0000000..ad3a697
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32uint, write>;
+fn textureDimensions_3a94ea() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3a94ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3a94ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3a94ea();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl
new file mode 100644
index 0000000..984a409
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a94ea() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.msl
new file mode 100644
index 0000000..baedbc7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3a94ea() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3a94ea();
+ return;
+}
+
+
+tint_IJj3j3.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_IJj3j3.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm
new file mode 100644
index 0000000..e1132c3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3a94ea "textureDimensions_3a94ea"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3a94ea = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_3a94ea
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_3a94ea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_3a94ea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl
new file mode 100644
index 0000000..f1acdc1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32uint>;
+
+fn textureDimensions_3a94ea() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3a94ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3a94ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3a94ea();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl
new file mode 100644
index 0000000..e9735ce
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32float, write>;
+fn textureDimensions_3aca08() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3aca08();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3aca08();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3aca08();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl
new file mode 100644
index 0000000..5a88e3b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3aca08() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.msl
new file mode 100644
index 0000000..e12c743
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3aca08() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3aca08();
+ return;
+}
+
+
+tint_DgMBiO.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm
new file mode 100644
index 0000000..a191b3e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3aca08 "textureDimensions_3aca08"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3aca08 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_3aca08
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_3aca08
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_3aca08
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl
new file mode 100644
index 0000000..2c8cb95
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32float>;
+
+fn textureDimensions_3aca08() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3aca08();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3aca08();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3aca08();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl
new file mode 100644
index 0000000..30d77c0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8sint, write>;
+fn textureDimensions_3c5ad8() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3c5ad8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3c5ad8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3c5ad8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl
new file mode 100644
index 0000000..15ccdf1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_3c5ad8() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.msl
new file mode 100644
index 0000000..4263889
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3c5ad8() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3c5ad8();
+ return;
+}
+
+
+tint_WN6S73.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_WN6S73.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm
new file mode 100644
index 0000000..90d93e5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3c5ad8 "textureDimensions_3c5ad8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3c5ad8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_3c5ad8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_3c5ad8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3c5ad8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl
new file mode 100644
index 0000000..ea66097
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8sint>;
+
+fn textureDimensions_3c5ad8() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3c5ad8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3c5ad8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3c5ad8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl
new file mode 100644
index 0000000..f09f6f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16uint, read>;
+fn textureDimensions_3d5817() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3d5817();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3d5817();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3d5817();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl
new file mode 100644
index 0000000..28ac7bf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_3d5817() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.msl
new file mode 100644
index 0000000..9b81afb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3d5817() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3d5817();
+ return;
+}
+
+
+tint_a86Ot5.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm
new file mode 100644
index 0000000..f33f81e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3d5817 "textureDimensions_3d5817"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3d5817 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_3d5817
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_3d5817
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3d5817
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl
new file mode 100644
index 0000000..21e8ab0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16uint>;
+
+fn textureDimensions_3d5817() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3d5817();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3d5817();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3d5817();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl
new file mode 100644
index 0000000..ab806b3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+fn textureDimensions_3e0403() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3e0403();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3e0403();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3e0403();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl
new file mode 100644
index 0000000..bdad7cf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3e0403() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl
new file mode 100644
index 0000000..73a0f66
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3e0403() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3e0403();
+ return;
+}
+
+
+tint_12sPbd.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_12sPbd.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_12sPbd.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm
new file mode 100644
index 0000000..41e422d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3e0403 "textureDimensions_3e0403"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3e0403 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_3e0403
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_3e0403
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_3e0403
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl
new file mode 100644
index 0000000..769dcc4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_3e0403() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3e0403();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3e0403();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3e0403();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl
new file mode 100644
index 0000000..14d0b63
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube_array;
+fn textureDimensions_3e626d() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3e626d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3e626d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3e626d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl
new file mode 100644
index 0000000..a279501
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_3e626d() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl
new file mode 100644
index 0000000..8821401
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3e626d() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_3e626d();
+ return;
+}
+
+
+tint_ZTQ9Wa.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_ZTQ9Wa.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_ZTQ9Wa.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm
new file mode 100644
index 0000000..056eb24
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3e626d "textureDimensions_3e626d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_3e626d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_1
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_3e626d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_3e626d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_3e626d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl
new file mode 100644
index 0000000..1fb3dbd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_3e626d() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_3e626d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_3e626d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_3e626d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl
new file mode 100644
index 0000000..f8f4dd4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8uint, read>;
+fn textureDimensions_40bc10() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_40bc10();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_40bc10();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_40bc10();
+}
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl
new file mode 100644
index 0000000..5a4ba74
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_40bc10() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.msl
new file mode 100644
index 0000000..ab8ed04
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40bc10() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_40bc10();
+ return;
+}
+
+
+tint_ukJagZ.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm
new file mode 100644
index 0000000..228f0b5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_40bc10 "textureDimensions_40bc10"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_40bc10 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_40bc10
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_40bc10
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_40bc10
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl
new file mode 100644
index 0000000..0727714f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8uint>;
+
+fn textureDimensions_40bc10() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_40bc10();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_40bc10();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_40bc10();
+}
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl
new file mode 100644
index 0000000..f451b22
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<i32>;
+fn textureDimensions_423f99() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_423f99();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_423f99();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_423f99();
+}
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl
new file mode 100644
index 0000000..2896dcc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_423f99() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_423f99();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_423f99();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_423f99();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.msl
new file mode 100644
index 0000000..7a76a75
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_423f99() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_423f99();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_423f99();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_423f99();
+ return;
+}
+
+
+tint_mj2s9A.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm
new file mode 100644
index 0000000..75aeca4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_423f99 "textureDimensions_423f99"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_423f99 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %int %14 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_423f99
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_423f99
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_423f99
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl
new file mode 100644
index 0000000..1b008ff
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_423f99() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_423f99();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_423f99();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_423f99();
+}
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl
new file mode 100644
index 0000000..1d1c2ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32float, write>;
+fn textureDimensions_4267ee() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_4267ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_4267ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_4267ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl
new file mode 100644
index 0000000..aef602d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4267ee() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.msl
new file mode 100644
index 0000000..a494763
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4267ee() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_4267ee();
+ return;
+}
+
+
+tint_9XjQPO.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_9XjQPO.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm
new file mode 100644
index 0000000..5e24b4e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4267ee "textureDimensions_4267ee"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_4267ee = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_4267ee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_4267ee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4267ee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl
new file mode 100644
index 0000000..05b48af
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32float>;
+
+fn textureDimensions_4267ee() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_4267ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_4267ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_4267ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl
new file mode 100644
index 0000000..d2454e4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8unorm, write>;
+fn textureDimensions_42d4e6() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_42d4e6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_42d4e6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_42d4e6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl
new file mode 100644
index 0000000..6fc1b1a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_42d4e6() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.msl
new file mode 100644
index 0000000..35fac39
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_42d4e6() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_42d4e6();
+ return;
+}
+
+
+tint_OEpToQ.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm
new file mode 100644
index 0000000..1291134
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_42d4e6 "textureDimensions_42d4e6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_42d4e6 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_42d4e6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_42d4e6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_42d4e6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl
new file mode 100644
index 0000000..92708fb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8unorm>;
+
+fn textureDimensions_42d4e6() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_42d4e6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_42d4e6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_42d4e6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl
new file mode 100644
index 0000000..937d79b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32uint, read>;
+fn textureDimensions_441392() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_441392();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_441392();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_441392();
+}
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl
new file mode 100644
index 0000000..67d2344
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_441392() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_441392();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_441392();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_441392();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.msl
new file mode 100644
index 0000000..981210f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_441392() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_441392();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_441392();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_441392();
+ return;
+}
+
+
+tint_J7rYXr.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm
new file mode 100644
index 0000000..fb56b4f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_441392 "textureDimensions_441392"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_441392 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_441392
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_441392
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_441392
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl
new file mode 100644
index 0000000..432e612
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32uint>;
+
+fn textureDimensions_441392() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_441392();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_441392();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_441392();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl
new file mode 100644
index 0000000..60991cd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16float, write>;
+fn textureDimensions_48cb89() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48cb89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48cb89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48cb89();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl
new file mode 100644
index 0000000..9f45377
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_48cb89() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.msl
new file mode 100644
index 0000000..52b7fa8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_48cb89() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_48cb89();
+ return;
+}
+
+
+tint_dswMSP.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_dswMSP.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm
new file mode 100644
index 0000000..c149ebe
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_48cb89 "textureDimensions_48cb89"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_48cb89 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_48cb89
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_48cb89
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_48cb89
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl
new file mode 100644
index 0000000..aaa4c33
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16float>;
+
+fn textureDimensions_48cb89() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48cb89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48cb89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48cb89();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl
new file mode 100644
index 0000000..38ecb4d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, read>;
+fn textureDimensions_48cbb2() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48cbb2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48cbb2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48cbb2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl
new file mode 100644
index 0000000..979d34f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_48cbb2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.msl
new file mode 100644
index 0000000..8ce4bb7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_48cbb2() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_48cbb2();
+ return;
+}
+
+
+tint_rl5Xrx.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_rl5Xrx.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm
new file mode 100644
index 0000000..54fe427
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_48cbb2 "textureDimensions_48cbb2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_48cbb2 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_48cbb2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_48cbb2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_48cbb2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl
new file mode 100644
index 0000000..180ebcf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32float>;
+
+fn textureDimensions_48cbb2() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48cbb2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48cbb2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48cbb2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl
new file mode 100644
index 0000000..9e24a9e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32sint, read>;
+fn textureDimensions_48f360() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48f360();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48f360();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48f360();
+}
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl
new file mode 100644
index 0000000..9fbc6c7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_48f360() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_48f360();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_48f360();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_48f360();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.msl
new file mode 100644
index 0000000..5757db6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_48f360() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_48f360();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_48f360();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_48f360();
+ return;
+}
+
+
+tint_uKd3an.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_uKd3an.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm
new file mode 100644
index 0000000..b86a2ec
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_48f360 "textureDimensions_48f360"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_48f360 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_48f360
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_48f360
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_48f360
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl
new file mode 100644
index 0000000..3fa6ac8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32sint>;
+
+fn textureDimensions_48f360() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_48f360();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_48f360();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_48f360();
+}
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl
new file mode 100644
index 0000000..25adf50
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, write>;
+fn textureDimensions_49d274() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_49d274();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_49d274();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_49d274();
+}
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl
new file mode 100644
index 0000000..1523867
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_49d274() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_49d274();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_49d274();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_49d274();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.msl
new file mode 100644
index 0000000..fe0d210
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_49d274() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_49d274();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_49d274();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_49d274();
+ return;
+}
+
+
+tint_VhbHeD.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_VhbHeD.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm
new file mode 100644
index 0000000..099c090
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_49d274 "textureDimensions_49d274"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_49d274 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_49d274
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_49d274
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_49d274
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a08ece
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32sint>;
+
+fn textureDimensions_49d274() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_49d274();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_49d274();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_49d274();
+}
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl
new file mode 100644
index 0000000..fe40ade
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32uint, write>;
+fn textureDimensions_4df9a8() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_4df9a8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_4df9a8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_4df9a8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl
new file mode 100644
index 0000000..1203833
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_4df9a8() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.msl
new file mode 100644
index 0000000..38a04a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4df9a8() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_4df9a8();
+ return;
+}
+
+
+tint_gTHNDu.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm
new file mode 100644
index 0000000..2aa1708
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4df9a8 "textureDimensions_4df9a8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_4df9a8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_4df9a8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_4df9a8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4df9a8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c597ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32uint>;
+
+fn textureDimensions_4df9a8() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_4df9a8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_4df9a8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_4df9a8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl
new file mode 100644
index 0000000..3d070db
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32float, write>;
+fn textureDimensions_55b23e() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_55b23e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_55b23e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_55b23e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl
new file mode 100644
index 0000000..b595443
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_55b23e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.msl
new file mode 100644
index 0000000..72474f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_55b23e() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_55b23e();
+ return;
+}
+
+
+tint_bIR2Jm.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm
new file mode 100644
index 0000000..4899a5f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_55b23e "textureDimensions_55b23e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_55b23e = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_55b23e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_55b23e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_55b23e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl
new file mode 100644
index 0000000..bb617fa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32float>;
+
+fn textureDimensions_55b23e() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_55b23e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_55b23e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_55b23e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl
new file mode 100644
index 0000000..479a5c5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16float, read>;
+fn textureDimensions_56ccfa() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_56ccfa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_56ccfa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_56ccfa();
+}
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl
new file mode 100644
index 0000000..f6855fe
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_56ccfa() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.msl
new file mode 100644
index 0000000..287a299
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_56ccfa() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_56ccfa();
+ return;
+}
+
+
+tint_7x14H7.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_7x14H7.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_7x14H7.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm
new file mode 100644
index 0000000..0cc05de
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_56ccfa "textureDimensions_56ccfa"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_56ccfa = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_56ccfa
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_56ccfa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_56ccfa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl
new file mode 100644
index 0000000..caa5fca
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16float>;
+
+fn textureDimensions_56ccfa() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_56ccfa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_56ccfa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_56ccfa();
+}
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl
new file mode 100644
index 0000000..19fb810
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<u32>;
+fn textureDimensions_579629() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_579629();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_579629();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_579629();
+}
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl
new file mode 100644
index 0000000..797af6b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_579629() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_579629();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_579629();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_579629();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.msl
new file mode 100644
index 0000000..535dea4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_579629() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_579629();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_579629();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_579629();
+ return;
+}
+
+
+tint_FOf5JR.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_FOf5JR.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm
new file mode 100644
index 0000000..7de9341
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_579629 "textureDimensions_579629"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_579629 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_579629
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_579629
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_579629
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl
new file mode 100644
index 0000000..2b6608f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureDimensions_579629() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_579629();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_579629();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_579629();
+}
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl
new file mode 100644
index 0000000..7f4e08f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32uint, write>;
+fn textureDimensions_57da0b() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_57da0b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_57da0b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_57da0b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl
new file mode 100644
index 0000000..3c8852b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_57da0b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.msl
new file mode 100644
index 0000000..0f18c54
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_57da0b() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_57da0b();
+ return;
+}
+
+
+tint_0q7tmr.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm
new file mode 100644
index 0000000..b619011
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_57da0b "textureDimensions_57da0b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_57da0b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_57da0b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_57da0b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_57da0b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c28634f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32uint>;
+
+fn textureDimensions_57da0b() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_57da0b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_57da0b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_57da0b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl
new file mode 100644
index 0000000..6b07538
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8snorm, read>;
+fn textureDimensions_57e7b3() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_57e7b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_57e7b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_57e7b3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl
new file mode 100644
index 0000000..bf491cb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_57e7b3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.msl
new file mode 100644
index 0000000..1cd19c3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_57e7b3() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_57e7b3();
+ return;
+}
+
+
+tint_ZD9nyd.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ZD9nyd.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ZD9nyd.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..501de7b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_57e7b3 "textureDimensions_57e7b3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_57e7b3 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_57e7b3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_57e7b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_57e7b3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..2de1c5d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8snorm>;
+
+fn textureDimensions_57e7b3() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_57e7b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_57e7b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_57e7b3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl
new file mode 100644
index 0000000..abe400b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, write>;
+fn textureDimensions_58a515() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_58a515();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_58a515();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_58a515();
+}
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl
new file mode 100644
index 0000000..dde543e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_58a515() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_58a515();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_58a515();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_58a515();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.msl
new file mode 100644
index 0000000..1adcb54
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_58a515() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_58a515();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_58a515();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_58a515();
+ return;
+}
+
+
+tint_XaWz8h.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_XaWz8h.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm
new file mode 100644
index 0000000..c0f19b4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_58a515 "textureDimensions_58a515"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_58a515 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_58a515
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_58a515
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_58a515
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl
new file mode 100644
index 0000000..c909b43
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16float>;
+
+fn textureDimensions_58a515() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_58a515();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_58a515();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_58a515();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl
new file mode 100644
index 0000000..2b87708
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, write>;
+fn textureDimensions_5985f3() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5985f3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5985f3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5985f3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl
new file mode 100644
index 0000000..9bd1140
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_5985f3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.msl
new file mode 100644
index 0000000..c012972
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5985f3() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_5985f3();
+ return;
+}
+
+
+tint_hRnD1E.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_hRnD1E.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..fa73029
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5985f3 "textureDimensions_5985f3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_5985f3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_5985f3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_5985f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_5985f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..28e8229
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureDimensions_5985f3() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5985f3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5985f3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5985f3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl
new file mode 100644
index 0000000..c907865
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32uint, write>;
+fn textureDimensions_5caa5e() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5caa5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5caa5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5caa5e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl
new file mode 100644
index 0000000..d250720
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_5caa5e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.msl
new file mode 100644
index 0000000..3d20f68
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5caa5e() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_5caa5e();
+ return;
+}
+
+
+tint_pj9O9H.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..4890fee
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5caa5e "textureDimensions_5caa5e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_5caa5e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_5caa5e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_5caa5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_5caa5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..f1dfd35
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32uint>;
+
+fn textureDimensions_5caa5e() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5caa5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5caa5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5caa5e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl
new file mode 100644
index 0000000..be0e8ed
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, write>;
+fn textureDimensions_5e295d() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5e295d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5e295d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5e295d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl
new file mode 100644
index 0000000..3123bda
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_5e295d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.msl
new file mode 100644
index 0000000..ce3951e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5e295d() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_5e295d();
+ return;
+}
+
+
+tint_MszFa3.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_MszFa3.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm
new file mode 100644
index 0000000..bb02735
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5e295d "textureDimensions_5e295d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_5e295d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_5e295d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_5e295d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_5e295d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl
new file mode 100644
index 0000000..493103b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureDimensions_5e295d() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5e295d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5e295d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5e295d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl
new file mode 100644
index 0000000..839f64a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<u32>;
+fn textureDimensions_5ec4e1() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5ec4e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5ec4e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5ec4e1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl
new file mode 100644
index 0000000..4aa8f3e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_5ec4e1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl
new file mode 100644
index 0000000..2f6bffb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5ec4e1() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_5ec4e1();
+ return;
+}
+
+
+tint_zI0Hei.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_zI0Hei.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_zI0Hei.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm
new file mode 100644
index 0000000..2e4dbd2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5ec4e1 "textureDimensions_5ec4e1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %22 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_5ec4e1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %18 %int_1
+ %13 = OpVectorShuffle %v3int %16 %16 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureDimensions_5ec4e1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_5ec4e1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_5ec4e1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl
new file mode 100644
index 0000000..b0aa472
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_5ec4e1() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_5ec4e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_5ec4e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_5ec4e1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl
new file mode 100644
index 0000000..5a1f3c4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32sint, write>;
+fn textureDimensions_60bf54() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_60bf54();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_60bf54();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_60bf54();
+}
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl
new file mode 100644
index 0000000..34334ee
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_60bf54() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.msl
new file mode 100644
index 0000000..1018d0a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_60bf54() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_60bf54();
+ return;
+}
+
+
+tint_nwkB68.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_nwkB68.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_nwkB68.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm
new file mode 100644
index 0000000..8980759
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_60bf54 "textureDimensions_60bf54"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_60bf54 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_60bf54
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_60bf54
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_60bf54
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl
new file mode 100644
index 0000000..f2dd194
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32sint>;
+
+fn textureDimensions_60bf54() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_60bf54();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_60bf54();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_60bf54();
+}
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl
new file mode 100644
index 0000000..1a87d61
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32float, write>;
+fn textureDimensions_63f3cf() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_63f3cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_63f3cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_63f3cf();
+}
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl
new file mode 100644
index 0000000..fcfed00
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_63f3cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.msl
new file mode 100644
index 0000000..8d6a0b7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_63f3cf() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_63f3cf();
+ return;
+}
+
+
+tint_xOZqUk.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xOZqUk.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_xOZqUk.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..35ab54b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_63f3cf "textureDimensions_63f3cf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_63f3cf = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_63f3cf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_63f3cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_63f3cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..b408be4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32float>;
+
+fn textureDimensions_63f3cf() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_63f3cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_63f3cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_63f3cf();
+}
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl
new file mode 100644
index 0000000..6fe3476
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, read>;
+fn textureDimensions_66dc4e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_66dc4e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_66dc4e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_66dc4e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl
new file mode 100644
index 0000000..0c86dc6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_66dc4e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.msl
new file mode 100644
index 0000000..96ac5f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_66dc4e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_66dc4e();
+ return;
+}
+
+
+tint_cbPOlr.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_cbPOlr.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm
new file mode 100644
index 0000000..63ab7f6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_66dc4e "textureDimensions_66dc4e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_66dc4e = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_66dc4e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_66dc4e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_66dc4e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl
new file mode 100644
index 0000000..35b621a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureDimensions_66dc4e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_66dc4e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_66dc4e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_66dc4e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl
new file mode 100644
index 0000000..1893db1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32float, read>;
+fn textureDimensions_670d90() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_670d90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_670d90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_670d90();
+}
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl
new file mode 100644
index 0000000..8da3ae1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_670d90() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_670d90();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_670d90();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_670d90();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.msl
new file mode 100644
index 0000000..e392d86
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_670d90() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_670d90();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_670d90();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_670d90();
+ return;
+}
+
+
+tint_pQtIJE.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_pQtIJE.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_pQtIJE.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm
new file mode 100644
index 0000000..09d9df8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_670d90 "textureDimensions_670d90"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_670d90 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_670d90
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_670d90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_670d90
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl
new file mode 100644
index 0000000..553906b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32float>;
+
+fn textureDimensions_670d90() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_670d90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_670d90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_670d90();
+}
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl
new file mode 100644
index 0000000..47040f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32uint, write>;
+fn textureDimensions_68105c() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_68105c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_68105c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_68105c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl
new file mode 100644
index 0000000..01c571d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_68105c() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_68105c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_68105c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_68105c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.msl
new file mode 100644
index 0000000..7908305
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_68105c() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_68105c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_68105c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_68105c();
+ return;
+}
+
+
+tint_ImHXh7.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_ImHXh7.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm
new file mode 100644
index 0000000..2f3a801
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_68105c "textureDimensions_68105c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_68105c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_68105c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_68105c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_68105c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl
new file mode 100644
index 0000000..979666e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32uint>;
+
+fn textureDimensions_68105c() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_68105c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_68105c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_68105c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl
new file mode 100644
index 0000000..8ed6e68
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32sint, write>;
+fn textureDimensions_6adac6() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6adac6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6adac6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6adac6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl
new file mode 100644
index 0000000..8e90341
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_6adac6() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.msl
new file mode 100644
index 0000000..7c2faab
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6adac6() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_6adac6();
+ return;
+}
+
+
+tint_kowEvS.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm
new file mode 100644
index 0000000..0030afd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6adac6 "textureDimensions_6adac6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_6adac6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_6adac6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_6adac6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6adac6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef544c7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32sint>;
+
+fn textureDimensions_6adac6() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6adac6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6adac6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6adac6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl
new file mode 100644
index 0000000..6560c31
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32float, read>;
+fn textureDimensions_6c08ab() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6c08ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6c08ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6c08ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl
new file mode 100644
index 0000000..a4b0f25
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_6c08ab() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.msl
new file mode 100644
index 0000000..35a3973
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6c08ab() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_6c08ab();
+ return;
+}
+
+
+tint_R7GQmD.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..4f28d72
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6c08ab "textureDimensions_6c08ab"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_6c08ab = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_6c08ab
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_6c08ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6c08ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..a43bd5d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32float>;
+
+fn textureDimensions_6c08ab() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6c08ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6c08ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6c08ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl
new file mode 100644
index 0000000..5f143a0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8sint, read>;
+fn textureDimensions_6e2d12() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6e2d12();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6e2d12();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6e2d12();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl
new file mode 100644
index 0000000..68c8298
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_6e2d12() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.msl
new file mode 100644
index 0000000..e74d8c8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6e2d12() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_6e2d12();
+ return;
+}
+
+
+tint_b9AESR.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm
new file mode 100644
index 0000000..3be8eef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6e2d12 "textureDimensions_6e2d12"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_6e2d12 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_6e2d12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_6e2d12
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6e2d12
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl
new file mode 100644
index 0000000..c1496a7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8sint>;
+
+fn textureDimensions_6e2d12() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6e2d12();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6e2d12();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6e2d12();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl
new file mode 100644
index 0000000..a8f2f38
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<u32>;
+fn textureDimensions_6ec1b4() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6ec1b4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6ec1b4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6ec1b4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl
new file mode 100644
index 0000000..f32020e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_6ec1b4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.msl
new file mode 100644
index 0000000..17889b5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6ec1b4() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_6ec1b4();
+ return;
+}
+
+
+tint_K0FZJY.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_K0FZJY.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_K0FZJY.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm
new file mode 100644
index 0000000..69bfc00
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6ec1b4 "textureDimensions_6ec1b4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_6ec1b4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v3int %16 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_6ec1b4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6ec1b4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_6ec1b4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl
new file mode 100644
index 0000000..543e010
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_6ec1b4() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6ec1b4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6ec1b4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6ec1b4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl
new file mode 100644
index 0000000..81d1dd7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+fn textureDimensions_6f0d79() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6f0d79();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6f0d79();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6f0d79();
+}
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl
new file mode 100644
index 0000000..f64072d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_6f0d79() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.msl
new file mode 100644
index 0000000..979f71a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6f0d79() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_6f0d79();
+ return;
+}
+
+
+tint_xB7TMS.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_xB7TMS.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm
new file mode 100644
index 0000000..207ca7b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6f0d79 "textureDimensions_6f0d79"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_6f0d79 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_6f0d79
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6f0d79
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_6f0d79
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl
new file mode 100644
index 0000000..77931a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureDimensions_6f0d79() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_6f0d79();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_6f0d79();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_6f0d79();
+}
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl
new file mode 100644
index 0000000..ab009e8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8unorm, write>;
+fn textureDimensions_702c53() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_702c53();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_702c53();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_702c53();
+}
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl
new file mode 100644
index 0000000..3900595
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_702c53() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_702c53();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_702c53();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_702c53();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.msl
new file mode 100644
index 0000000..5120e59
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_702c53() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_702c53();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_702c53();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_702c53();
+ return;
+}
+
+
+tint_XEg02Y.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_XEg02Y.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm
new file mode 100644
index 0000000..2054bf8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_702c53 "textureDimensions_702c53"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_702c53 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_702c53
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_702c53
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_702c53
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl
new file mode 100644
index 0000000..79bc870
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
+
+fn textureDimensions_702c53() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_702c53();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_702c53();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_702c53();
+}
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl
new file mode 100644
index 0000000..c513572
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32uint, read>;
+fn textureDimensions_70e26a() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_70e26a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_70e26a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_70e26a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl
new file mode 100644
index 0000000..80e8478
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_70e26a() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.msl
new file mode 100644
index 0000000..15a4b62
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_70e26a() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_70e26a();
+ return;
+}
+
+
+tint_YKLVNs.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm
new file mode 100644
index 0000000..93669b5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_70e26a "textureDimensions_70e26a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_70e26a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_70e26a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_70e26a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_70e26a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl
new file mode 100644
index 0000000..5fa2f99
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32uint>;
+
+fn textureDimensions_70e26a() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_70e26a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_70e26a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_70e26a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl
new file mode 100644
index 0000000..5c3f959
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32uint, read>;
+fn textureDimensions_71e8f7() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_71e8f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_71e8f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_71e8f7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl
new file mode 100644
index 0000000..27bb78a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_71e8f7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.msl
new file mode 100644
index 0000000..6fa1f68
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_71e8f7() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_71e8f7();
+ return;
+}
+
+
+tint_s1L8fA.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_s1L8fA.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..659fd98
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_71e8f7 "textureDimensions_71e8f7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_71e8f7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_71e8f7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_71e8f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_71e8f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..a78950c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32uint>;
+
+fn textureDimensions_71e8f7() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_71e8f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_71e8f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_71e8f7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl
new file mode 100644
index 0000000..33045e7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d_array;
+fn textureDimensions_72e5d6() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_72e5d6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_72e5d6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_72e5d6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl
new file mode 100644
index 0000000..f7a5391
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_72e5d6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.msl
new file mode 100644
index 0000000..8367897
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_72e5d6() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_72e5d6();
+ return;
+}
+
+
+tint_nWOwt2.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_nWOwt2.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm
new file mode 100644
index 0000000..09ce4e7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_72e5d6 "textureDimensions_72e5d6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_72e5d6 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_1
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_72e5d6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_72e5d6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_72e5d6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl
new file mode 100644
index 0000000..d81fb59
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_72e5d6() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_72e5d6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_72e5d6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_72e5d6();
+}
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl
new file mode 100644
index 0000000..e3135e0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+fn textureDimensions_75be9d() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_75be9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_75be9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_75be9d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl
new file mode 100644
index 0000000..4847eda
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_75be9d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl
new file mode 100644
index 0000000..4cfb4d4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_75be9d() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_75be9d();
+ return;
+}
+
+
+tint_8I50aH.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_8I50aH.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_8I50aH.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm
new file mode 100644
index 0000000..85976e7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_75be9d "textureDimensions_75be9d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_75be9d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_1
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_75be9d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_75be9d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_75be9d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl
new file mode 100644
index 0000000..65e0b26
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_75be9d() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_75be9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_75be9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_75be9d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl
new file mode 100644
index 0000000..641a922
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+fn textureDimensions_76e722() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_76e722();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_76e722();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_76e722();
+}
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl
new file mode 100644
index 0000000..f8e330d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_76e722() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_76e722();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_76e722();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_76e722();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl
new file mode 100644
index 0000000..3be4993
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_76e722() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_76e722();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_76e722();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_76e722();
+ return;
+}
+
+
+tint_rCoJkt.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_rCoJkt.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_rCoJkt.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm
new file mode 100644
index 0000000..2f5aadd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_76e722 "textureDimensions_76e722"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_76e722 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_0
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_76e722
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_76e722
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_76e722
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl
new file mode 100644
index 0000000..e69e66f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+fn textureDimensions_76e722() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_76e722();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_76e722();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_76e722();
+}
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl
new file mode 100644
index 0000000..bf9e0d9f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32float, read>;
+fn textureDimensions_770103() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_770103();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_770103();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_770103();
+}
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl
new file mode 100644
index 0000000..70cf96c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_770103() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_770103();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_770103();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_770103();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.msl
new file mode 100644
index 0000000..f65d8cd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_770103() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_770103();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_770103();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_770103();
+ return;
+}
+
+
+tint_bsVnyq.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_bsVnyq.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_bsVnyq.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm
new file mode 100644
index 0000000..0847108
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_770103 "textureDimensions_770103"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_770103 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_770103
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_770103
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_770103
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl
new file mode 100644
index 0000000..9e79ca4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32float>;
+
+fn textureDimensions_770103() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_770103();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_770103();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_770103();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl
new file mode 100644
index 0000000..3b5d490
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<i32>;
+fn textureDimensions_7bb707() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7bb707();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7bb707();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7bb707();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl
new file mode 100644
index 0000000..9c245c2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_7bb707() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl
new file mode 100644
index 0000000..7fe0dd5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7bb707() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_7bb707();
+ return;
+}
+
+
+tint_VyEaVz.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_VyEaVz.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_VyEaVz.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm
new file mode 100644
index 0000000..993f04a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7bb707 "textureDimensions_7bb707"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_7bb707 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_1
+ %13 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_7bb707
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7bb707
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_7bb707
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl
new file mode 100644
index 0000000..0042867
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_7bb707() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7bb707();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7bb707();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7bb707();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl
new file mode 100644
index 0000000..d8c9051
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d_array;
+fn textureDimensions_7bf826() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7bf826();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7bf826();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7bf826();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl
new file mode 100644
index 0000000..50ced2c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_7bf826() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.msl
new file mode 100644
index 0000000..7f217c2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7bf826() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_7bf826();
+ return;
+}
+
+
+tint_fEyKMk.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_fEyKMk.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm
new file mode 100644
index 0000000..e898a26
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7bf826 "textureDimensions_7bf826"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_7bf826 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_0
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_7bf826
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7bf826
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_7bf826
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl
new file mode 100644
index 0000000..112470d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_7bf826() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7bf826();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7bf826();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7bf826();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl
new file mode 100644
index 0000000..0f76288
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32sint, write>;
+fn textureDimensions_7f5c2e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7f5c2e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7f5c2e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7f5c2e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl
new file mode 100644
index 0000000..a5c971c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_7f5c2e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.msl
new file mode 100644
index 0000000..8f23096
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7f5c2e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_7f5c2e();
+ return;
+}
+
+
+tint_V3gAt9.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_V3gAt9.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea3ec8c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7f5c2e "textureDimensions_7f5c2e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_7f5c2e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_7f5c2e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_7f5c2e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7f5c2e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl
new file mode 100644
index 0000000..3295f78
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32sint>;
+
+fn textureDimensions_7f5c2e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_7f5c2e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_7f5c2e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_7f5c2e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl
new file mode 100644
index 0000000..b6a6b4b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32float, write>;
+fn textureDimensions_8028f3() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8028f3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8028f3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8028f3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl
new file mode 100644
index 0000000..bd8d496
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8028f3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.msl
new file mode 100644
index 0000000..8563a27
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8028f3() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8028f3();
+ return;
+}
+
+
+tint_rNXDNa.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_rNXDNa.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_rNXDNa.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..8eedc4b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8028f3 "textureDimensions_8028f3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8028f3 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_8028f3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_8028f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_8028f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..75cf9c5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32float>;
+
+fn textureDimensions_8028f3() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8028f3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8028f3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8028f3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl
new file mode 100644
index 0000000..184ac8f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32uint, write>;
+fn textureDimensions_811679() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_811679();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_811679();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_811679();
+}
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl
new file mode 100644
index 0000000..b01fc27
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_811679() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_811679();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_811679();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_811679();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.msl
new file mode 100644
index 0000000..963c634
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_811679() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_811679();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_811679();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_811679();
+ return;
+}
+
+
+tint_zUXsFf.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_zUXsFf.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_zUXsFf.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm
new file mode 100644
index 0000000..235e2f9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_811679 "textureDimensions_811679"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_811679 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_811679
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_811679
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_811679
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl
new file mode 100644
index 0000000..20d46b4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32uint>;
+
+fn textureDimensions_811679() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_811679();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_811679();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_811679();
+}
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl
new file mode 100644
index 0000000..e4fbff7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32uint, write>;
+fn textureDimensions_820596() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_820596();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_820596();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_820596();
+}
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl
new file mode 100644
index 0000000..0130c6e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_820596() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_820596();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_820596();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_820596();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.msl
new file mode 100644
index 0000000..83c960f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_820596() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_820596();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_820596();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_820596();
+ return;
+}
+
+
+tint_wPNSW7.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wPNSW7.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wPNSW7.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm
new file mode 100644
index 0000000..cfa018e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_820596 "textureDimensions_820596"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_820596 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_820596
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_820596
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_820596
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl
new file mode 100644
index 0000000..82ef750
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32uint>;
+
+fn textureDimensions_820596() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_820596();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_820596();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_820596();
+}
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl
new file mode 100644
index 0000000..adc59d2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16uint, read>;
+fn textureDimensions_82138e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_82138e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_82138e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_82138e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl
new file mode 100644
index 0000000..2f824cf
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_82138e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_82138e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_82138e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_82138e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.msl
new file mode 100644
index 0000000..83d6afb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_82138e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_82138e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_82138e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_82138e();
+ return;
+}
+
+
+tint_Npp6pY.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_Npp6pY.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm
new file mode 100644
index 0000000..22715d5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_82138e "textureDimensions_82138e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_82138e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_82138e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_82138e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_82138e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl
new file mode 100644
index 0000000..7e21445
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16uint>;
+
+fn textureDimensions_82138e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_82138e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_82138e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_82138e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl
new file mode 100644
index 0000000..80ade64
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8snorm, read>;
+fn textureDimensions_8347ab() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8347ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8347ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8347ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl
new file mode 100644
index 0000000..eb82bb9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_8347ab() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.msl
new file mode 100644
index 0000000..a000567
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8347ab() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8347ab();
+ return;
+}
+
+
+tint_gN8oSM.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..63f5a4a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8347ab "textureDimensions_8347ab"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8347ab = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_8347ab
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_8347ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_8347ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ad5bcb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8snorm>;
+
+fn textureDimensions_8347ab() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8347ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8347ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8347ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl
new file mode 100644
index 0000000..b275c0b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32sint, write>;
+fn textureDimensions_83ee5a() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_83ee5a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_83ee5a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_83ee5a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl
new file mode 100644
index 0000000..e4628b8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_83ee5a() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.msl
new file mode 100644
index 0000000..7f51f22
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_83ee5a() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_83ee5a();
+ return;
+}
+
+
+tint_H9Kwto.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_H9Kwto.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..46d81e1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_83ee5a "textureDimensions_83ee5a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_83ee5a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_83ee5a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_83ee5a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_83ee5a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..c65be39
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32sint>;
+
+fn textureDimensions_83ee5a() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_83ee5a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_83ee5a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_83ee5a();
+}
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl
new file mode 100644
index 0000000..d9e829b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+fn textureDimensions_85d556() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_85d556();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_85d556();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_85d556();
+}
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl
new file mode 100644
index 0000000..ce3a43c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_85d556() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_85d556();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_85d556();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_85d556();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.msl
new file mode 100644
index 0000000..f9e9e2e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_85d556() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_85d556();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_85d556();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_85d556();
+ return;
+}
+
+
+tint_now3jP.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_now3jP.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm
new file mode 100644
index 0000000..ed97d5a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_85d556 "textureDimensions_85d556"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_85d556 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_1
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_85d556
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_85d556
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_85d556
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl
new file mode 100644
index 0000000..d0074ca
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_85d556() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_85d556();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_85d556();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_85d556();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl
new file mode 100644
index 0000000..72469f3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32sint, read>;
+fn textureDimensions_8799ee() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8799ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8799ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8799ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl
new file mode 100644
index 0000000..149cef7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_8799ee() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.msl
new file mode 100644
index 0000000..aa12070
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8799ee() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8799ee();
+ return;
+}
+
+
+tint_oFGVm6.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_oFGVm6.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_oFGVm6.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d3e426
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8799ee "textureDimensions_8799ee"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8799ee = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_8799ee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_8799ee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_8799ee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl
new file mode 100644
index 0000000..490113a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32sint>;
+
+fn textureDimensions_8799ee() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8799ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8799ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8799ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl
new file mode 100644
index 0000000..778784c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16float, read>;
+fn textureDimensions_89a864() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_89a864();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_89a864();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_89a864();
+}
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl
new file mode 100644
index 0000000..77eda67
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_89a864() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_89a864();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_89a864();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_89a864();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.msl
new file mode 100644
index 0000000..d851f90
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_89a864() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_89a864();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_89a864();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_89a864();
+ return;
+}
+
+
+tint_d9UcqL.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_d9UcqL.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d4534e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_89a864 "textureDimensions_89a864"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_89a864 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_89a864
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_89a864
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_89a864
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1c46be
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16float>;
+
+fn textureDimensions_89a864() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_89a864();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_89a864();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_89a864();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl
new file mode 100644
index 0000000..ac87df5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+fn textureDimensions_8aa4c4() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8aa4c4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8aa4c4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8aa4c4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl
new file mode 100644
index 0000000..609c45d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_8aa4c4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.msl
new file mode 100644
index 0000000..0b99082
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8aa4c4() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8aa4c4();
+ return;
+}
+
+
+tint_Jf2SUf.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Jf2SUf.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Jf2SUf.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm
new file mode 100644
index 0000000..232ff24
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8aa4c4 "textureDimensions_8aa4c4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8aa4c4 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v3int %15 %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_8aa4c4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8aa4c4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_8aa4c4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl
new file mode 100644
index 0000000..cbf79d1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_8aa4c4() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8aa4c4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8aa4c4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8aa4c4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl
new file mode 100644
index 0000000..7eb8bd5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32sint, read>;
+fn textureDimensions_8b4fff() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8b4fff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8b4fff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8b4fff();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl
new file mode 100644
index 0000000..ac00230
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_8b4fff() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.msl
new file mode 100644
index 0000000..24a76ac
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8b4fff() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8b4fff();
+ return;
+}
+
+
+tint_HYEIin.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_HYEIin.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm
new file mode 100644
index 0000000..6692c0f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8b4fff "textureDimensions_8b4fff"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8b4fff = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_8b4fff
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_8b4fff
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_8b4fff
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl
new file mode 100644
index 0000000..ee0d0f6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32sint>;
+
+fn textureDimensions_8b4fff() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8b4fff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8b4fff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8b4fff();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl
new file mode 100644
index 0000000..e57c3b3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32sint, read>;
+fn textureDimensions_8d89f8() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8d89f8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8d89f8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8d89f8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl
new file mode 100644
index 0000000..ac6eff3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_8d89f8() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.msl
new file mode 100644
index 0000000..5028c40
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8d89f8() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8d89f8();
+ return;
+}
+
+
+tint_VjxWxy.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm
new file mode 100644
index 0000000..69e2f9e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8d89f8 "textureDimensions_8d89f8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8d89f8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_8d89f8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_8d89f8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_8d89f8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl
new file mode 100644
index 0000000..af68992
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32sint>;
+
+fn textureDimensions_8d89f8() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8d89f8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8d89f8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8d89f8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl
new file mode 100644
index 0000000..6fdb2d4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<i32>;
+fn textureDimensions_8deb5e() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8deb5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8deb5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8deb5e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl
new file mode 100644
index 0000000..c4107a4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_8deb5e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.msl
new file mode 100644
index 0000000..2000e18
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8deb5e() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8deb5e();
+ return;
+}
+
+
+tint_sSlF0R.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_sSlF0R.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_sSlF0R.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..d30a104
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8deb5e "textureDimensions_8deb5e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8deb5e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v3int %15 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_8deb5e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8deb5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_8deb5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..4974865
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_8deb5e() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8deb5e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8deb5e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8deb5e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl
new file mode 100644
index 0000000..bc6e1fa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32float, write>;
+fn textureDimensions_8fca0f() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8fca0f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8fca0f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8fca0f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl
new file mode 100644
index 0000000..8214607
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8fca0f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.msl
new file mode 100644
index 0000000..3466bc5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8fca0f() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_8fca0f();
+ return;
+}
+
+
+tint_ROXO5D.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ROXO5D.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ROXO5D.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm
new file mode 100644
index 0000000..8429e41
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8fca0f "textureDimensions_8fca0f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_8fca0f = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_8fca0f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_8fca0f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_8fca0f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl
new file mode 100644
index 0000000..b901463
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32float>;
+
+fn textureDimensions_8fca0f() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_8fca0f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_8fca0f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_8fca0f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl
new file mode 100644
index 0000000..9c96fb8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, write>;
+fn textureDimensions_9042ab() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9042ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9042ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9042ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl
new file mode 100644
index 0000000..a3b30b6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9042ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.msl
new file mode 100644
index 0000000..83b4534
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9042ab() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9042ab();
+ return;
+}
+
+
+tint_B1qgWW.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_B1qgWW.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..62cae56
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9042ab "textureDimensions_9042ab"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9042ab = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_9042ab
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9042ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_9042ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..b7936ee
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32uint>;
+
+fn textureDimensions_9042ab() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9042ab();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9042ab();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9042ab();
+}
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl
new file mode 100644
index 0000000..d0da65c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<u32>;
+fn textureDimensions_91f42d() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_91f42d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_91f42d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_91f42d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl
new file mode 100644
index 0000000..507282e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_91f42d() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl
new file mode 100644
index 0000000..2a44126
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_91f42d() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_91f42d();
+ return;
+}
+
+
+tint_G9KC5u.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_G9KC5u.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_G9KC5u.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm
new file mode 100644
index 0000000..02e408d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_91f42d "textureDimensions_91f42d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_91f42d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %17 %int_1
+ %13 = OpVectorShuffle %v3int %16 %16 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_91f42d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_91f42d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_91f42d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl
new file mode 100644
index 0000000..2fbb191
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_91f42d() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_91f42d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_91f42d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_91f42d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl
new file mode 100644
index 0000000..8866e2d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32uint, read>;
+fn textureDimensions_924742() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_924742();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_924742();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_924742();
+}
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl
new file mode 100644
index 0000000..9485df7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_924742() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_924742();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_924742();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_924742();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.msl
new file mode 100644
index 0000000..af8bd0a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_924742() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_924742();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_924742();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_924742();
+ return;
+}
+
+
+tint_wgXnIZ.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wgXnIZ.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wgXnIZ.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd49cac
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_924742 "textureDimensions_924742"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_924742 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_924742
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_924742
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_924742
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl
new file mode 100644
index 0000000..f497afa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32uint>;
+
+fn textureDimensions_924742() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_924742();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_924742();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_924742();
+}
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl
new file mode 100644
index 0000000..c2f758f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8uint, read>;
+fn textureDimensions_92ad20() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_92ad20();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_92ad20();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_92ad20();
+}
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl
new file mode 100644
index 0000000..847c0c8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_92ad20() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.msl
new file mode 100644
index 0000000..9e963ac
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_92ad20() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_92ad20();
+ return;
+}
+
+
+tint_u1hm4E.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_u1hm4E.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_u1hm4E.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm
new file mode 100644
index 0000000..7bfccd3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_92ad20 "textureDimensions_92ad20"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_92ad20 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_92ad20
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_92ad20
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_92ad20
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl
new file mode 100644
index 0000000..f66e8a8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8uint>;
+
+fn textureDimensions_92ad20() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_92ad20();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_92ad20();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_92ad20();
+}
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl
new file mode 100644
index 0000000..1c92cde
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+fn textureDimensions_939fdb() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_939fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_939fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_939fdb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl
new file mode 100644
index 0000000..66e5086
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_939fdb() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.msl
new file mode 100644
index 0000000..8f97c1b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_939fdb() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_939fdb();
+ return;
+}
+
+
+tint_uyPO2n.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_uyPO2n.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm
new file mode 100644
index 0000000..a219560
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_939fdb "textureDimensions_939fdb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_939fdb = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v2int %15 %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_939fdb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_939fdb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_939fdb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl
new file mode 100644
index 0000000..afb11df
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+fn textureDimensions_939fdb() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_939fdb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_939fdb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_939fdb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl
new file mode 100644
index 0000000..17c6b56
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8unorm, read>;
+fn textureDimensions_9572e5() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9572e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9572e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9572e5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl
new file mode 100644
index 0000000..3e53391
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9572e5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.msl
new file mode 100644
index 0000000..55bbe37
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9572e5() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9572e5();
+ return;
+}
+
+
+tint_ubERwe.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ubERwe.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_ubERwe.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6b65e7c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9572e5 "textureDimensions_9572e5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9572e5 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_9572e5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_9572e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9572e5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl
new file mode 100644
index 0000000..2c75848
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8unorm>;
+
+fn textureDimensions_9572e5() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9572e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9572e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9572e5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl
new file mode 100644
index 0000000..3fb8e60
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, read>;
+fn textureDimensions_998f6b() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_998f6b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_998f6b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_998f6b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl
new file mode 100644
index 0000000..27f1091
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_998f6b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.msl
new file mode 100644
index 0000000..b2a3245
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_998f6b() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_998f6b();
+ return;
+}
+
+
+tint_rna27I.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_rna27I.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm
new file mode 100644
index 0000000..0a970f2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_998f6b "textureDimensions_998f6b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_998f6b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_998f6b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_998f6b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_998f6b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl
new file mode 100644
index 0000000..e299aa9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureDimensions_998f6b() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_998f6b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_998f6b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_998f6b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl
new file mode 100644
index 0000000..54066f9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, write>;
+fn textureDimensions_9abfe5() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9abfe5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9abfe5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9abfe5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl
new file mode 100644
index 0000000..753587a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_9abfe5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.msl
new file mode 100644
index 0000000..f510b8d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9abfe5() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9abfe5();
+ return;
+}
+
+
+tint_aLx7To.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_aLx7To.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6102757
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9abfe5 "textureDimensions_9abfe5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9abfe5 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_9abfe5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_9abfe5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_9abfe5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl
new file mode 100644
index 0000000..1d0b4d5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32float>;
+
+fn textureDimensions_9abfe5() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9abfe5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9abfe5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9abfe5();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl
new file mode 100644
index 0000000..6020ce4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<i32>;
+fn textureDimensions_9c9c57() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9c9c57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9c9c57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9c9c57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl
new file mode 100644
index 0000000..18217fc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_9c9c57() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.msl
new file mode 100644
index 0000000..f8f5356
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9c9c57() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9c9c57();
+ return;
+}
+
+
+tint_NYnjny.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_NYnjny.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm
new file mode 100644
index 0000000..c6b4449
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9c9c57 "textureDimensions_9c9c57"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9c9c57 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_1
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_9c9c57
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9c9c57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_9c9c57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl
new file mode 100644
index 0000000..20f18b7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_9c9c57() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9c9c57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9c9c57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9c9c57();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl
new file mode 100644
index 0000000..58f6515
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8sint, write>;
+fn textureDimensions_9da9e2() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9da9e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9da9e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9da9e2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl
new file mode 100644
index 0000000..3b3689b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_9da9e2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.msl
new file mode 100644
index 0000000..6fb03a5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9da9e2() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9da9e2();
+ return;
+}
+
+
+tint_LQ6PJO.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm
new file mode 100644
index 0000000..e31891f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9da9e2 "textureDimensions_9da9e2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9da9e2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_9da9e2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_9da9e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_9da9e2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl
new file mode 100644
index 0000000..042e716
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8sint>;
+
+fn textureDimensions_9da9e2() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9da9e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9da9e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9da9e2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl
new file mode 100644
index 0000000..6a537c0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32uint, write>;
+fn textureDimensions_9eb8d8() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9eb8d8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9eb8d8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9eb8d8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl
new file mode 100644
index 0000000..dcc6236
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9eb8d8() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.msl
new file mode 100644
index 0000000..6d9361f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9eb8d8() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9eb8d8();
+ return;
+}
+
+
+tint_A2F2rt.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_A2F2rt.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..3882431
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9eb8d8 "textureDimensions_9eb8d8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9eb8d8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_9eb8d8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9eb8d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_9eb8d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..0d67656
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32uint>;
+
+fn textureDimensions_9eb8d8() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9eb8d8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9eb8d8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9eb8d8();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl
new file mode 100644
index 0000000..5688e42
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+fn textureDimensions_9f8e46() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9f8e46();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9f8e46();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9f8e46();
+}
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl
new file mode 100644
index 0000000..0e573aa
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9f8e46() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.msl
new file mode 100644
index 0000000..df82743
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9f8e46() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_9f8e46();
+ return;
+}
+
+
+tint_bK96vd.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_bK96vd.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm
new file mode 100644
index 0000000..0167c50
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9f8e46 "textureDimensions_9f8e46"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_9f8e46 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v2int %15 %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_9f8e46
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9f8e46
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_9f8e46
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl
new file mode 100644
index 0000000..be69dc6d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_9f8e46() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_9f8e46();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_9f8e46();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_9f8e46();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl
new file mode 100644
index 0000000..52a8778
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32sint, read>;
+fn textureDimensions_a0aad1() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a0aad1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a0aad1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a0aad1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl
new file mode 100644
index 0000000..0209158
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a0aad1() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.msl
new file mode 100644
index 0000000..dee0891
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a0aad1() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_a0aad1();
+ return;
+}
+
+
+tint_9s1OKb.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_9s1OKb.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm
new file mode 100644
index 0000000..20969b8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a0aad1 "textureDimensions_a0aad1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_a0aad1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_a0aad1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_a0aad1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_a0aad1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl
new file mode 100644
index 0000000..ecedf37
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32sint>;
+
+fn textureDimensions_a0aad1() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a0aad1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a0aad1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a0aad1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl
new file mode 100644
index 0000000..987701c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8sint, read>;
+fn textureDimensions_a0e4ec() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a0e4ec();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a0e4ec();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a0e4ec();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl
new file mode 100644
index 0000000..8938df9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a0e4ec() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.msl
new file mode 100644
index 0000000..62aed2c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a0e4ec() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_a0e4ec();
+ return;
+}
+
+
+tint_Gx3LOP.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Gx3LOP.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_Gx3LOP.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm
new file mode 100644
index 0000000..aef6121
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a0e4ec "textureDimensions_a0e4ec"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_a0e4ec = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_a0e4ec
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_a0e4ec
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_a0e4ec
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa2d645
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8sint>;
+
+fn textureDimensions_a0e4ec() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a0e4ec();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a0e4ec();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a0e4ec();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl
new file mode 100644
index 0000000..8509d5f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+fn textureDimensions_a6ca1c() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a6ca1c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a6ca1c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a6ca1c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl
new file mode 100644
index 0000000..3485629
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_a6ca1c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl
new file mode 100644
index 0000000..7955481
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a6ca1c() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_a6ca1c();
+ return;
+}
+
+
+tint_QYHqWT.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_QYHqWT.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_QYHqWT.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm
new file mode 100644
index 0000000..e5d9159
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a6ca1c "textureDimensions_a6ca1c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_a6ca1c = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_1
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_a6ca1c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_a6ca1c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_a6ca1c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl
new file mode 100644
index 0000000..2c6b2bc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+fn textureDimensions_a6ca1c() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a6ca1c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a6ca1c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a6ca1c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl
new file mode 100644
index 0000000..94542d3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<u32>;
+fn textureDimensions_a7d565() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a7d565();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a7d565();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a7d565();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl
new file mode 100644
index 0000000..aa02095
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_a7d565() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.msl
new file mode 100644
index 0000000..867a1b7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a7d565() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_a7d565();
+ return;
+}
+
+
+tint_9E9ULI.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm
new file mode 100644
index 0000000..bf76e16
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a7d565 "textureDimensions_a7d565"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_a7d565 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %int %15 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_a7d565
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_a7d565
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_a7d565
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl
new file mode 100644
index 0000000..194c128
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_a7d565() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a7d565();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a7d565();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a7d565();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl
new file mode 100644
index 0000000..104a9ee
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32float, write>;
+fn textureDimensions_a863f2() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a863f2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a863f2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a863f2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl
new file mode 100644
index 0000000..1cc4b99
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_a863f2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.msl
new file mode 100644
index 0000000..f44cdd5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a863f2() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_a863f2();
+ return;
+}
+
+
+tint_wjS4Td.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ec7cf7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a863f2 "textureDimensions_a863f2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_a863f2 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_a863f2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_a863f2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_a863f2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl
new file mode 100644
index 0000000..cfb1854
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32float>;
+
+fn textureDimensions_a863f2() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_a863f2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_a863f2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_a863f2();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl
new file mode 100644
index 0000000..4b81975
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, read>;
+fn textureDimensions_ae457f() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ae457f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ae457f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ae457f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl
new file mode 100644
index 0000000..67ab5d1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_ae457f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.msl
new file mode 100644
index 0000000..707857c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ae457f() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_ae457f();
+ return;
+}
+
+
+tint_fBh8Vy.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_fBh8Vy.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm
new file mode 100644
index 0000000..d65d270
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ae457f "textureDimensions_ae457f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_ae457f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_ae457f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_ae457f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_ae457f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl
new file mode 100644
index 0000000..7764208
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureDimensions_ae457f() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ae457f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ae457f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ae457f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl
new file mode 100644
index 0000000..2f5db9e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<i32>;
+fn textureDimensions_b0e16d() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_b0e16d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_b0e16d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_b0e16d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl
new file mode 100644
index 0000000..9f083d5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_b0e16d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.msl
new file mode 100644
index 0000000..4749a78
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b0e16d() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_b0e16d();
+ return;
+}
+
+
+tint_Qlz1ri.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_Qlz1ri.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm
new file mode 100644
index 0000000..7c076e6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b0e16d "textureDimensions_b0e16d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_b0e16d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v2int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_b0e16d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_b0e16d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_b0e16d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl
new file mode 100644
index 0000000..6908dfb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_b0e16d() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_b0e16d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_b0e16d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_b0e16d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl
new file mode 100644
index 0000000..da39110
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8snorm, write>;
+fn textureDimensions_b91240() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_b91240();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_b91240();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_b91240();
+}
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl
new file mode 100644
index 0000000..2b5ea2a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_b91240() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_b91240();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_b91240();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b91240();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.msl
new file mode 100644
index 0000000..a2c9940
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b91240() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_b91240();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_b91240();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_b91240();
+ return;
+}
+
+
+tint_KzkVEm.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_KzkVEm.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm
new file mode 100644
index 0000000..0ce5cc8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b91240 "textureDimensions_b91240"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_b91240 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_b91240
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_b91240
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_b91240
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl
new file mode 100644
index 0000000..18cb6c5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8snorm>;
+
+fn textureDimensions_b91240() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_b91240();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_b91240();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_b91240();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl
new file mode 100644
index 0000000..870a110
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_external;
+fn textureDimensions_ba1481() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ba1481();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ba1481();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ba1481();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl
new file mode 100644
index 0000000..b54cbda
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_ba1481() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.msl
new file mode 100644
index 0000000..a4422c7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ba1481() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_ba1481();
+ return;
+}
+
+
+tint_kAFvfK.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_kAFvfK.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm
new file mode 100644
index 0000000..66376a0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ba1481 "textureDimensions_ba1481"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_ba1481 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySizeLod %v2int %15 %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_ba1481
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_ba1481
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_ba1481
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl
new file mode 100644
index 0000000..7fad75b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : external_texture;
+
+fn textureDimensions_ba1481() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ba1481();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ba1481();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ba1481();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl
new file mode 100644
index 0000000..bb0be1d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32float, read>;
+fn textureDimensions_ba6e15() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ba6e15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ba6e15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ba6e15();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl
new file mode 100644
index 0000000..aee8136
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_ba6e15() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.msl
new file mode 100644
index 0000000..367a409
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ba6e15() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_ba6e15();
+ return;
+}
+
+
+tint_2PV8R2.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_2PV8R2.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm
new file mode 100644
index 0000000..a49144e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ba6e15 "textureDimensions_ba6e15"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_ba6e15 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_ba6e15
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ba6e15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_ba6e15
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl
new file mode 100644
index 0000000..a1bde09
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32float>;
+
+fn textureDimensions_ba6e15() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ba6e15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ba6e15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ba6e15();
+}
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl
new file mode 100644
index 0000000..c16641c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32sint, write>;
+fn textureDimensions_bb3dde() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_bb3dde();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_bb3dde();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_bb3dde();
+}
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl
new file mode 100644
index 0000000..456c682
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_bb3dde() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.msl
new file mode 100644
index 0000000..dd2c2ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bb3dde() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_bb3dde();
+ return;
+}
+
+
+tint_RiPDug.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_RiPDug.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_RiPDug.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm
new file mode 100644
index 0000000..e828d98
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bb3dde "textureDimensions_bb3dde"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_bb3dde = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_bb3dde
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_bb3dde
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_bb3dde
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl
new file mode 100644
index 0000000..e754d08
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32sint>;
+
+fn textureDimensions_bb3dde() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_bb3dde();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_bb3dde();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_bb3dde();
+}
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl
new file mode 100644
index 0000000..824cc37
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube_array;
+fn textureDimensions_bdf2ee() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_bdf2ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_bdf2ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_bdf2ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl
new file mode 100644
index 0000000..d309747
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_bdf2ee() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl
new file mode 100644
index 0000000..630b31f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bdf2ee() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_bdf2ee();
+ return;
+}
+
+
+tint_i7osat.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_i7osat.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_i7osat.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm
new file mode 100644
index 0000000..95ab289
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bdf2ee "textureDimensions_bdf2ee"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_bdf2ee = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_bdf2ee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_bdf2ee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_bdf2ee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl
new file mode 100644
index 0000000..97f8936
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_bdf2ee() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_bdf2ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_bdf2ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_bdf2ee();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl
new file mode 100644
index 0000000..9a6a731
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, read>;
+fn textureDimensions_c2215f() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c2215f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c2215f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c2215f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl
new file mode 100644
index 0000000..dcb01ec
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_c2215f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.msl
new file mode 100644
index 0000000..57ddc42
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c2215f() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_c2215f();
+ return;
+}
+
+
+tint_J5e0DN.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_J5e0DN.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm
new file mode 100644
index 0000000..a4eb711
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c2215f "textureDimensions_c2215f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_c2215f = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_c2215f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_c2215f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_c2215f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl
new file mode 100644
index 0000000..1835175
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32float>;
+
+fn textureDimensions_c2215f() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c2215f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c2215f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c2215f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl
new file mode 100644
index 0000000..3a27045
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32sint, write>;
+fn textureDimensions_c30e75() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c30e75();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c30e75();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c30e75();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl
new file mode 100644
index 0000000..2c32e82
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_c30e75() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.msl
new file mode 100644
index 0000000..074981f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c30e75() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_c30e75();
+ return;
+}
+
+
+tint_SwzetC.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_SwzetC.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm
new file mode 100644
index 0000000..8e8edd9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c30e75 "textureDimensions_c30e75"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_c30e75 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_c30e75
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_c30e75
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_c30e75
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl
new file mode 100644
index 0000000..2419e83
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32sint>;
+
+fn textureDimensions_c30e75() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c30e75();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c30e75();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c30e75();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl
new file mode 100644
index 0000000..7e62f03
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16sint, read>;
+fn textureDimensions_c60b66() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c60b66();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c60b66();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c60b66();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl
new file mode 100644
index 0000000..21925cc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_c60b66() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.msl
new file mode 100644
index 0000000..10be8b6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c60b66() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_c60b66();
+ return;
+}
+
+
+tint_6k1Wwt.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm
new file mode 100644
index 0000000..339b568
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c60b66 "textureDimensions_c60b66"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_c60b66 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_c60b66
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_c60b66
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_c60b66
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl
new file mode 100644
index 0000000..9825a31
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16sint>;
+
+fn textureDimensions_c60b66() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c60b66();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c60b66();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c60b66();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl
new file mode 100644
index 0000000..d6eb0a1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32uint, read>;
+fn textureDimensions_c74533() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c74533();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c74533();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c74533();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl
new file mode 100644
index 0000000..bc9d1ef
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_c74533() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_c74533();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_c74533();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c74533();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.msl
new file mode 100644
index 0000000..49ee7a1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c74533() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_c74533();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_c74533();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_c74533();
+ return;
+}
+
+
+tint_E6igyy.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_E6igyy.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm
new file mode 100644
index 0000000..d03a057
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c74533 "textureDimensions_c74533"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_c74533 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_c74533
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c74533
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_c74533
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl
new file mode 100644
index 0000000..f232e4f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32uint>;
+
+fn textureDimensions_c74533() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c74533();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c74533();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c74533();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl
new file mode 100644
index 0000000..cc6af89
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8uint, write>;
+fn textureDimensions_c7943d() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c7943d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c7943d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c7943d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl
new file mode 100644
index 0000000..3c90423
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_c7943d() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.msl
new file mode 100644
index 0000000..ba4f2af
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c7943d() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_c7943d();
+ return;
+}
+
+
+tint_3yQidg.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_3yQidg.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm
new file mode 100644
index 0000000..7c935b0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c7943d "textureDimensions_c7943d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_c7943d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_c7943d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c7943d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_c7943d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl
new file mode 100644
index 0000000..bcb79d8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8uint>;
+
+fn textureDimensions_c7943d() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_c7943d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_c7943d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_c7943d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl
new file mode 100644
index 0000000..e563cf2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, read>;
+fn textureDimensions_caaabb() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_caaabb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_caaabb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_caaabb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl
new file mode 100644
index 0000000..69e4489
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_caaabb() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.msl
new file mode 100644
index 0000000..2d6d08a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_caaabb() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_caaabb();
+ return;
+}
+
+
+tint_DJpP79.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_DJpP79.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb25aca
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_caaabb "textureDimensions_caaabb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_caaabb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_caaabb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_caaabb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_caaabb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl
new file mode 100644
index 0000000..90c1c28
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32sint>;
+
+fn textureDimensions_caaabb() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_caaabb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_caaabb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_caaabb();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl
new file mode 100644
index 0000000..ddf9b2c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8unorm, read>;
+fn textureDimensions_cc5478() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cc5478();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cc5478();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cc5478();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl
new file mode 100644
index 0000000..0f9326e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cc5478() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.msl
new file mode 100644
index 0000000..bdfff9e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cc5478() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cc5478();
+ return;
+}
+
+
+tint_0velK0.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm
new file mode 100644
index 0000000..6bec852
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cc5478 "textureDimensions_cc5478"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cc5478 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_cc5478
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_cc5478
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cc5478
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl
new file mode 100644
index 0000000..baf34af
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8unorm>;
+
+fn textureDimensions_cc5478() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cc5478();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cc5478();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cc5478();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl
new file mode 100644
index 0000000..53edbe6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32sint, write>;
+fn textureDimensions_cc968c() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cc968c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cc968c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cc968c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl
new file mode 100644
index 0000000..3410404
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cc968c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.msl
new file mode 100644
index 0000000..b306a45
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cc968c() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cc968c();
+ return;
+}
+
+
+tint_6Q5H36.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm
new file mode 100644
index 0000000..a1322ae
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cc968c "textureDimensions_cc968c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cc968c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_cc968c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_cc968c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cc968c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa5b5b2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32sint>;
+
+fn textureDimensions_cc968c() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cc968c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cc968c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cc968c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl
new file mode 100644
index 0000000..4a95021
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<i32>;
+fn textureDimensions_cccc17() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cccc17();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cccc17();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cccc17();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl
new file mode 100644
index 0000000..743516c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_cccc17() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl
new file mode 100644
index 0000000..ab3854a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cccc17() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cccc17();
+ return;
+}
+
+
+tint_U2fIpr.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_U2fIpr.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_U2fIpr.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d67eeb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cccc17 "textureDimensions_cccc17"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cccc17 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_0
+ %13 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_cccc17
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_cccc17
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_cccc17
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl
new file mode 100644
index 0000000..7b1d7bd
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_cccc17() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cccc17();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cccc17();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cccc17();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl
new file mode 100644
index 0000000..663339f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8snorm, write>;
+fn textureDimensions_cccc8f() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cccc8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cccc8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cccc8f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl
new file mode 100644
index 0000000..0888f24
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cccc8f() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.msl
new file mode 100644
index 0000000..8a8b48b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cccc8f() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cccc8f();
+ return;
+}
+
+
+tint_OCbEI7.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..ffb7c50
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cccc8f "textureDimensions_cccc8f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cccc8f = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_cccc8f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_cccc8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cccc8f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7b4ce0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8snorm>;
+
+fn textureDimensions_cccc8f() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cccc8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cccc8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cccc8f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl
new file mode 100644
index 0000000..5025753
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8unorm, write>;
+fn textureDimensions_cd76a7() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cd76a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cd76a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cd76a7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl
new file mode 100644
index 0000000..babcfe1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cd76a7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.msl
new file mode 100644
index 0000000..1b1d170
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cd76a7() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cd76a7();
+ return;
+}
+
+
+tint_VISNvu.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_VISNvu.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_VISNvu.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1b8e49
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cd76a7 "textureDimensions_cd76a7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cd76a7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_cd76a7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_cd76a7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_cd76a7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff0d168
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8unorm>;
+
+fn textureDimensions_cd76a7() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cd76a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cd76a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cd76a7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl
new file mode 100644
index 0000000..2383f87
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32float, read>;
+fn textureDimensions_cdaff9() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cdaff9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cdaff9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cdaff9();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl
new file mode 100644
index 0000000..c7fba3f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cdaff9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.msl
new file mode 100644
index 0000000..d1ae8a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cdaff9() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cdaff9();
+ return;
+}
+
+
+tint_wkmQk8.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wkmQk8.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_wkmQk8.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm
new file mode 100644
index 0000000..ca690e7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cdaff9 "textureDimensions_cdaff9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cdaff9 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_cdaff9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_cdaff9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_cdaff9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl
new file mode 100644
index 0000000..f69c2b5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32float>;
+
+fn textureDimensions_cdaff9() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cdaff9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cdaff9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cdaff9();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl
new file mode 100644
index 0000000..9a18a7d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, write>;
+fn textureDimensions_cdf473() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cdf473();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cdf473();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cdf473();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl
new file mode 100644
index 0000000..0c847db
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cdf473() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.msl
new file mode 100644
index 0000000..eb92cd3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cdf473() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cdf473();
+ return;
+}
+
+
+tint_qj2hGZ.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_qj2hGZ.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm
new file mode 100644
index 0000000..674d1c4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cdf473 "textureDimensions_cdf473"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cdf473 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_cdf473
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cdf473
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_cdf473
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f02298
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureDimensions_cdf473() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cdf473();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cdf473();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cdf473();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl
new file mode 100644
index 0000000..f341fe2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+fn textureDimensions_cec841() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cec841();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cec841();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cec841();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl
new file mode 100644
index 0000000..44fed34
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cec841() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_cec841();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cec841();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cec841();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.msl
new file mode 100644
index 0000000..4f2cda2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cec841() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cec841();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cec841();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cec841();
+ return;
+}
+
+
+tint_SwK5DB.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_SwK5DB.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm
new file mode 100644
index 0000000..caa966a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cec841 "textureDimensions_cec841"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cec841 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_0
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_cec841
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_cec841
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_cec841
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa1ee13
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_cec841() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cec841();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cec841();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cec841();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl
new file mode 100644
index 0000000..a06115f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16float, read>;
+fn textureDimensions_cf1d42() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cf1d42();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cf1d42();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cf1d42();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl
new file mode 100644
index 0000000..06a1367
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cf1d42() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.msl
new file mode 100644
index 0000000..d69b8c7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cf1d42() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cf1d42();
+ return;
+}
+
+
+tint_S83f2X.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm
new file mode 100644
index 0000000..03d962d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cf1d42 "textureDimensions_cf1d42"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cf1d42 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_cf1d42
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_cf1d42
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cf1d42
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl
new file mode 100644
index 0000000..bdae356
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16float>;
+
+fn textureDimensions_cf1d42() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cf1d42();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cf1d42();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cf1d42();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl
new file mode 100644
index 0000000..30cf759
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8snorm, write>;
+fn textureDimensions_cf7e43() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cf7e43();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cf7e43();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cf7e43();
+}
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl
new file mode 100644
index 0000000..b2e6947
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cf7e43() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.msl
new file mode 100644
index 0000000..23e8921
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cf7e43() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_cf7e43();
+ return;
+}
+
+
+tint_TeMQxk.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_TeMQxk.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_TeMQxk.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm
new file mode 100644
index 0000000..b268aae
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cf7e43 "textureDimensions_cf7e43"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %18 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_cf7e43 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v3int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_cf7e43
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_cf7e43
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_cf7e43
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl
new file mode 100644
index 0000000..ccdd94f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8snorm>;
+
+fn textureDimensions_cf7e43() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_cf7e43();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_cf7e43();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_cf7e43();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl
new file mode 100644
index 0000000..2387895
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8sint, read>;
+fn textureDimensions_d40b9e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d40b9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d40b9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d40b9e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl
new file mode 100644
index 0000000..2943bb5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_d40b9e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.msl
new file mode 100644
index 0000000..ebe5e39
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d40b9e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_d40b9e();
+ return;
+}
+
+
+tint_X1JMnR.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_X1JMnR.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..9408183
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d40b9e "textureDimensions_d40b9e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_d40b9e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_d40b9e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_d40b9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_d40b9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..83398fb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8sint>;
+
+fn textureDimensions_d40b9e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d40b9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d40b9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d40b9e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl
new file mode 100644
index 0000000..fee84c3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16sint, read>;
+fn textureDimensions_d4106f() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d4106f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d4106f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d4106f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl
new file mode 100644
index 0000000..c38086e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_d4106f() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.msl
new file mode 100644
index 0000000..f044853
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d4106f() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_d4106f();
+ return;
+}
+
+
+tint_kMBhTg.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_kMBhTg.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ab2c0b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d4106f "textureDimensions_d4106f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_d4106f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_d4106f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_d4106f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_d4106f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl
new file mode 100644
index 0000000..fd06290
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16sint>;
+
+fn textureDimensions_d4106f() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d4106f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d4106f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d4106f();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl
new file mode 100644
index 0000000..dc9570a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32float, read>;
+fn textureDimensions_d8f951() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d8f951();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d8f951();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d8f951();
+}
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl
new file mode 100644
index 0000000..819ca59
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_d8f951() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.msl
new file mode 100644
index 0000000..ed1390a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d8f951() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_d8f951();
+ return;
+}
+
+
+tint_z7tLH4.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm
new file mode 100644
index 0000000..16cdf49
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d8f951 "textureDimensions_d8f951"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_d8f951 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_d8f951
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_d8f951
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_d8f951
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl
new file mode 100644
index 0000000..c41b14d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32float>;
+
+fn textureDimensions_d8f951() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_d8f951();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_d8f951();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_d8f951();
+}
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl
new file mode 100644
index 0000000..5df347c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16uint, read>;
+fn textureDimensions_da3099() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_da3099();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_da3099();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_da3099();
+}
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl
new file mode 100644
index 0000000..c474ad5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_da3099() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_da3099();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_da3099();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_da3099();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.msl
new file mode 100644
index 0000000..fc0d392
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_da3099() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_da3099();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_da3099();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_da3099();
+ return;
+}
+
+
+tint_O84Slz.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_O84Slz.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_O84Slz.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm
new file mode 100644
index 0000000..bf8331e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_da3099 "textureDimensions_da3099"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_da3099 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_da3099
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_da3099
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_da3099
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl
new file mode 100644
index 0000000..cd9fdad
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16uint>;
+
+fn textureDimensions_da3099() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_da3099();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_da3099();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_da3099();
+}
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl
new file mode 100644
index 0000000..3594279
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<i32>;
+fn textureDimensions_daf7c0() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_daf7c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_daf7c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_daf7c0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl
new file mode 100644
index 0000000..df5ba6f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_daf7c0() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.msl
new file mode 100644
index 0000000..3f79518
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_daf7c0() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_daf7c0();
+ return;
+}
+
+
+tint_5xXP11.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_5xXP11.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..3f0b9f7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_daf7c0 "textureDimensions_daf7c0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_daf7c0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_daf7c0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_daf7c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_daf7c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..181c2f0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureDimensions_daf7c0() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_daf7c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_daf7c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_daf7c0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl
new file mode 100644
index 0000000..fe52a14
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32uint, read>;
+fn textureDimensions_dba47c() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_dba47c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_dba47c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_dba47c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl
new file mode 100644
index 0000000..297cde7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_dba47c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.msl
new file mode 100644
index 0000000..2caf8c1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dba47c() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_dba47c();
+ return;
+}
+
+
+tint_EKCC5G.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm
new file mode 100644
index 0000000..54b70a5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dba47c "textureDimensions_dba47c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_dba47c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_dba47c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_dba47c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_dba47c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl
new file mode 100644
index 0000000..f702afb
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32uint>;
+
+fn textureDimensions_dba47c() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_dba47c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_dba47c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_dba47c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl
new file mode 100644
index 0000000..4e72a14
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8uint, write>;
+fn textureDimensions_dc2dd0() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_dc2dd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_dc2dd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_dc2dd0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl
new file mode 100644
index 0000000..a5f39b1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_dc2dd0() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.msl
new file mode 100644
index 0000000..46d0e98
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dc2dd0() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_dc2dd0();
+ return;
+}
+
+
+tint_uUYkvN.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm
new file mode 100644
index 0000000..fee701f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dc2dd0 "textureDimensions_dc2dd0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_dc2dd0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_dc2dd0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_dc2dd0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_dc2dd0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl
new file mode 100644
index 0000000..03c58ba
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8uint>;
+
+fn textureDimensions_dc2dd0() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_dc2dd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_dc2dd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_dc2dd0();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl
new file mode 100644
index 0000000..abe6f69
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8uint, read>;
+fn textureDimensions_e10157() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e10157();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e10157();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e10157();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl
new file mode 100644
index 0000000..46f2239
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e10157() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_e10157();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e10157();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e10157();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.msl
new file mode 100644
index 0000000..c0a6001
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e10157() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e10157();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e10157();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e10157();
+ return;
+}
+
+
+tint_i8ZUzz.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_i8ZUzz.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm
new file mode 100644
index 0000000..333a4c1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e10157 "textureDimensions_e10157"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e10157 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_e10157
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e10157
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_e10157
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl
new file mode 100644
index 0000000..4d62897
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8uint>;
+
+fn textureDimensions_e10157() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e10157();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e10157();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e10157();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl
new file mode 100644
index 0000000..9f27264
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<i32>;
+fn textureDimensions_e22247() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e22247();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e22247();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e22247();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl
new file mode 100644
index 0000000..d62e4c4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e22247() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_e22247();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e22247();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e22247();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl
new file mode 100644
index 0000000..76a891c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e22247() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_e22247();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e22247();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e22247();
+ return;
+}
+
+
+tint_57n5Dl.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_57n5Dl.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_57n5Dl.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm
new file mode 100644
index 0000000..818d5e7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e22247 "textureDimensions_e22247"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e22247 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_1
+ %13 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_e22247
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e22247
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_e22247
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl
new file mode 100644
index 0000000..520a4c4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_e22247() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e22247();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e22247();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e22247();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl
new file mode 100644
index 0000000..fe88bb9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32sint, read>;
+fn textureDimensions_e93464() {
+ var res: i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e93464();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e93464();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e93464();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl
new file mode 100644
index 0000000..77def20
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e93464() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ int res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_e93464();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e93464();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e93464();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.msl
new file mode 100644
index 0000000..ee0b851
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e93464() {
+ int res = int(arg_0.get_width());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e93464();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e93464();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e93464();
+ return;
+}
+
+
+tint_YaTuvv.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_width());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm
new file mode 100644
index 0000000..c6da4ff
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e93464 "textureDimensions_e93464"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e93464 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureDimensions_e93464
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureDimensions_e93464
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e93464
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl
new file mode 100644
index 0000000..f017f43
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32sint>;
+
+fn textureDimensions_e93464() {
+ var res : i32 = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e93464();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e93464();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e93464();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl
new file mode 100644
index 0000000..2ad145c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, read>;
+fn textureDimensions_e9628c() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9628c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9628c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9628c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl
new file mode 100644
index 0000000..5272b2d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_e9628c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.msl
new file mode 100644
index 0000000..5017a2d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e9628c() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e9628c();
+ return;
+}
+
+
+tint_MmSOA1.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_MmSOA1.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm
new file mode 100644
index 0000000..64d21e6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e9628c "textureDimensions_e9628c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e9628c = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_e9628c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e9628c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_e9628c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl
new file mode 100644
index 0000000..25127fe
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32float>;
+
+fn textureDimensions_e9628c() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9628c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9628c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9628c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl
new file mode 100644
index 0000000..0237b9f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, write>;
+fn textureDimensions_e9e96c() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9e96c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9e96c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9e96c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl
new file mode 100644
index 0000000..efb7f4d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_e9e96c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.msl
new file mode 100644
index 0000000..394dca6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e9e96c() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e9e96c();
+ return;
+}
+
+
+tint_AH7LwX.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_AH7LwX.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm
new file mode 100644
index 0000000..03ca8d5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e9e96c "textureDimensions_e9e96c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e9e96c = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_e9e96c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e9e96c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_e9e96c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl
new file mode 100644
index 0000000..7cafbf8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32float>;
+
+fn textureDimensions_e9e96c() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9e96c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9e96c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9e96c();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl
new file mode 100644
index 0000000..c9413c2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32uint, read>;
+fn textureDimensions_e9fe54() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9fe54();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9fe54();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9fe54();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl
new file mode 100644
index 0000000..c6793f2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e9fe54() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.msl
new file mode 100644
index 0000000..e1665b7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e9fe54() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e9fe54();
+ return;
+}
+
+
+tint_YVYyTW.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_YVYyTW.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm
new file mode 100644
index 0000000..c9c5d5b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e9fe54 "textureDimensions_e9fe54"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e9fe54 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v2int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_e9fe54
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e9fe54
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_e9fe54
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl
new file mode 100644
index 0000000..cd6f322
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32uint>;
+
+fn textureDimensions_e9fe54() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9fe54();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9fe54();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9fe54();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl
new file mode 100644
index 0000000..92d0fa1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, read>;
+fn textureDimensions_e9fe58() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9fe58();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9fe58();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9fe58();
+}
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl
new file mode 100644
index 0000000..3a61c1e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e9fe58() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.msl
new file mode 100644
index 0000000..a18dd38
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e9fe58() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_e9fe58();
+ return;
+}
+
+
+tint_RswUR8.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_RswUR8.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm
new file mode 100644
index 0000000..da7d41f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e9fe58 "textureDimensions_e9fe58"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_e9fe58 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_e9fe58
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_e9fe58
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_e9fe58
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl
new file mode 100644
index 0000000..7b81767
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32uint>;
+
+fn textureDimensions_e9fe58() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_e9fe58();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_e9fe58();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_e9fe58();
+}
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl
new file mode 100644
index 0000000..8e328a8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+fn textureDimensions_eda4e3() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_eda4e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_eda4e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_eda4e3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl
new file mode 100644
index 0000000..6034d6e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_eda4e3() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl
new file mode 100644
index 0000000..2290c1d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_eda4e3() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_eda4e3();
+ return;
+}
+
+
+tint_GLqIhV.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_GLqIhV.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+tint_GLqIhV.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_height(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm
new file mode 100644
index 0000000..83a4af6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_eda4e3 "textureDimensions_eda4e3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_eda4e3 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_1
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_eda4e3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_eda4e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_eda4e3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl
new file mode 100644
index 0000000..148c5de
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_eda4e3() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_eda4e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_eda4e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_eda4e3();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl
new file mode 100644
index 0000000..3273bca
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<f32>;
+fn textureDimensions_ef5b89() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ef5b89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ef5b89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ef5b89();
+}
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl
new file mode 100644
index 0000000..e7ff858
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_ef5b89() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.msl
new file mode 100644
index 0000000..93769a9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ef5b89() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_ef5b89();
+ return;
+}
+
+
+tint_MEwQTz.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_MEwQTz.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm
new file mode 100644
index 0000000..dbe5181
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ef5b89 "textureDimensions_ef5b89"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_ef5b89 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_ef5b89
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ef5b89
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_ef5b89
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl
new file mode 100644
index 0000000..dc089a7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureDimensions_ef5b89() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_ef5b89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_ef5b89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_ef5b89();
+}
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl
new file mode 100644
index 0000000..f0c4563
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<i32>;
+fn textureDimensions_efc8a4() {
+ var res: vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_efc8a4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_efc8a4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_efc8a4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl
new file mode 100644
index 0000000..ed94895
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_efc8a4() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int3 res = tint_tmp.xyz;
+}
+
+void vertex_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.msl
new file mode 100644
index 0000000..35d024c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_efc8a4() {
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_efc8a4();
+ return;
+}
+
+
+tint_VKcQYC.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_VKcQYC.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+tint_VKcQYC.metal:5:60: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(1), arg_0.get_height(1), arg_0.get_depth(1));
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c2a8d3
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_efc8a4 "textureDimensions_efc8a4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_efc8a4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v3int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_efc8a4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_efc8a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_efc8a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..88c7e1e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_efc8a4() {
+ var res : vec3<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_efc8a4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_efc8a4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_efc8a4();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl
new file mode 100644
index 0000000..bda8cbc
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32float, read>;
+fn textureDimensions_f1b72b() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f1b72b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f1b72b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f1b72b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl
new file mode 100644
index 0000000..5d97904
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f1b72b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.msl
new file mode 100644
index 0000000..f77285e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f1b72b() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f1b72b();
+ return;
+}
+
+
+tint_ABnmGI.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_ABnmGI.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a17cf54
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f1b72b "textureDimensions_f1b72b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f1b72b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_f1b72b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_f1b72b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f1b72b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl
new file mode 100644
index 0000000..e74dca4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32float>;
+
+fn textureDimensions_f1b72b() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f1b72b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f1b72b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f1b72b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl
new file mode 100644
index 0000000..99025ba
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+fn textureDimensions_f507c9() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f507c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f507c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f507c9();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl
new file mode 100644
index 0000000..e083f66
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f507c9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl
new file mode 100644
index 0000000..9263173
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f507c9() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f507c9();
+ return;
+}
+
+
+tint_bJqzWF.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_bJqzWF.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_bJqzWF.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..4827f1a
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f507c9 "textureDimensions_f507c9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %21 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f507c9 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v2int %17 %int_0
+ %12 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_f507c9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f507c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_f507c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..98211b7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_f507c9() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f507c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f507c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f507c9();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl
new file mode 100644
index 0000000..fe667e8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<i32>;
+fn textureDimensions_f70326() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f70326();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f70326();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f70326();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl
new file mode 100644
index 0000000..01c94f2
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f70326() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp.xyy;
+}
+
+void vertex_main() {
+ textureDimensions_f70326();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f70326();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f70326();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl
new file mode 100644
index 0000000..17338a7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f70326() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f70326();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f70326();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f70326();
+ return;
+}
+
+
+tint_fUHJfB.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_fUHJfB.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+tint_fUHJfB.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_height());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm
new file mode 100644
index 0000000..70a5677
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f70326 "textureDimensions_f70326"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f70326 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %20
+ %16 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %16 %int_0
+ %13 = OpVectorShuffle %v3int %15 %15 0 1 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_f70326
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_f70326
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_f70326
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl
new file mode 100644
index 0000000..e1de80d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_f70326() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f70326();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f70326();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f70326();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl
new file mode 100644
index 0000000..908ea16
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<u32>;
+fn textureDimensions_f7145b() {
+ var res: vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7145b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7145b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7145b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl
new file mode 100644
index 0000000..5b964ae
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_f7145b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.msl
new file mode 100644
index 0000000..260fc18
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f7145b() {
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+}
+
+vertex void vertex_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f7145b();
+ return;
+}
+
+
+tint_zCqbpt.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+tint_zCqbpt.metal:5:39: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(1), arg_0.get_height(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a484942
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f7145b "textureDimensions_f7145b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f7145b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v2int %16 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_f7145b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_f7145b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_f7145b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl
new file mode 100644
index 0000000..6da9903
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_f7145b() {
+ var res : vec2<i32> = textureDimensions(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7145b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7145b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7145b();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl
new file mode 100644
index 0000000..b1fc576
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, read>;
+fn textureDimensions_f7aa9e() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7aa9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7aa9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7aa9e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl
new file mode 100644
index 0000000..23a9a6c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f7aa9e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.msl
new file mode 100644
index 0000000..0ff3c91
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f7aa9e() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f7aa9e();
+ return;
+}
+
+
+tint_53o5jc.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_53o5jc.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..8e629d6
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f7aa9e "textureDimensions_f7aa9e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f7aa9e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_f7aa9e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_f7aa9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_f7aa9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..8f51070
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureDimensions_f7aa9e() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7aa9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7aa9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7aa9e();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl
new file mode 100644
index 0000000..3aafa81
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, read>;
+fn textureDimensions_f7e436() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7e436();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7e436();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7e436();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl
new file mode 100644
index 0000000..49ca1c1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_f7e436() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.msl
new file mode 100644
index 0000000..020b3f1
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f7e436() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f7e436();
+ return;
+}
+
+
+tint_qF7VTP.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_qF7VTP.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm
new file mode 100644
index 0000000..75f7e65
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f7e436 "textureDimensions_f7e436"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %21 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f7e436 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %18
+ %13 = OpVectorShuffle %v2int %16 %16 0 1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureDimensions_f7e436
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f7e436
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_f7e436
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl
new file mode 100644
index 0000000..5b003c5
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureDimensions_f7e436() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f7e436();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f7e436();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f7e436();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl
new file mode 100644
index 0000000..a434674
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32float, write>;
+fn textureDimensions_f931c7() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f931c7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f931c7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f931c7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl
new file mode 100644
index 0000000..611e994
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f931c7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.msl
new file mode 100644
index 0000000..204705e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f931c7() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_f931c7();
+ return;
+}
+
+
+tint_af2gOe.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_af2gOe.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm
new file mode 100644
index 0000000..726ba5b
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f931c7 "textureDimensions_f931c7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_f931c7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_f931c7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_f931c7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f931c7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl
new file mode 100644
index 0000000..4253c30
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32float>;
+
+fn textureDimensions_f931c7() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_f931c7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_f931c7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_f931c7();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl
new file mode 100644
index 0000000..bfe7139
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32float, read>;
+fn textureDimensions_fa90e1() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fa90e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fa90e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fa90e1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl
new file mode 100644
index 0000000..f5f998f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_fa90e1() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.msl
new file mode 100644
index 0000000..1325749
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fa90e1() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_fa90e1();
+ return;
+}
+
+
+tint_hCi2mv.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_hCi2mv.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm
new file mode 100644
index 0000000..e52ec7d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fa90e1 "textureDimensions_fa90e1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %18 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_fa90e1 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %18
+ %15 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySize %v2int %15
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureDimensions_fa90e1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_fa90e1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_fa90e1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl
new file mode 100644
index 0000000..546939f
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32float>;
+
+fn textureDimensions_fa90e1() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fa90e1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fa90e1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fa90e1();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl
new file mode 100644
index 0000000..25ce897
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<i32>;
+fn textureDimensions_fa9859() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fa9859();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fa9859();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fa9859();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl
new file mode 100644
index 0000000..9808fe7
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_fa9859() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ int2 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.msl
new file mode 100644
index 0000000..a5f4fea
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fa9859() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_fa9859();
+ return;
+}
+
+
+tint_Jef2wt.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_Jef2wt.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm
new file mode 100644
index 0000000..3d933f0
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fa9859 "textureDimensions_fa9859"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_fa9859 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySizeLod %v2int %15 %int_0
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_fa9859
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_fa9859
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_fa9859
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl
new file mode 100644
index 0000000..dab6521
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_fa9859() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fa9859();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fa9859();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fa9859();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl
new file mode 100644
index 0000000..3567a74
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, write>;
+fn textureDimensions_fb5670() {
+ var res: vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fb5670();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fb5670();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fb5670();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl
new file mode 100644
index 0000000..f749526
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_fb5670() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int2 res = tint_tmp.xy;
+}
+
+void vertex_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.msl
new file mode 100644
index 0000000..36ca780
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fb5670() {
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+}
+
+vertex void vertex_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_fb5670();
+ return;
+}
+
+
+tint_Rgwrfb.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+tint_Rgwrfb.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int2 res = int2(arg_0.get_width(), arg_0.get_height());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm
new file mode 100644
index 0000000..3cb0894
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fb5670 "textureDimensions_fb5670"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+%textureDimensions_fb5670 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %12 = OpVectorShuffle %v2int %15 %15 0 1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureDimensions_fb5670
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_fb5670
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_fb5670
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl
new file mode 100644
index 0000000..fc9f484
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32float>;
+
+fn textureDimensions_fb5670() {
+ var res : vec2<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fb5670();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fb5670();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fb5670();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl
new file mode 100644
index 0000000..ce6e8f9
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32uint, read>;
+fn textureDimensions_fbbe4d() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fbbe4d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fbbe4d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fbbe4d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl
new file mode 100644
index 0000000..227e90d
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_fbbe4d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.msl
new file mode 100644
index 0000000..b0454db
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fbbe4d() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_fbbe4d();
+ return;
+}
+
+
+tint_h7tqyr.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_h7tqyr.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_h7tqyr.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb79fac
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fbbe4d "textureDimensions_fbbe4d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_fbbe4d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_fbbe4d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_fbbe4d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_fbbe4d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl
new file mode 100644
index 0000000..1b311d4
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32uint>;
+
+fn textureDimensions_fbbe4d() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fbbe4d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fbbe4d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fbbe4d();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl
new file mode 100644
index 0000000..f8ce06e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8uint, write>;
+fn textureDimensions_fcac78() {
+ var res: vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fcac78();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fcac78();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fcac78();
+}
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl
new file mode 100644
index 0000000..97f637e
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_fcac78() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int3 res = tint_tmp;
+}
+
+void vertex_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
+void fragment_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.msl
new file mode 100644
index 0000000..e2ca28c
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.msl
@@ -0,0 +1,38 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fcac78() {
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+}
+
+vertex void vertex_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
+fragment void fragment_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
+kernel void compute_main() {
+ textureDimensions_fcac78();
+ return;
+}
+
+
+tint_nsbNpw.metal:5:19: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_nsbNpw.metal:5:38: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+tint_nsbNpw.metal:5:58: error: use of undeclared identifier 'arg_0'
+ int3 res = int3(arg_0.get_width(), arg_0.get_height(), arg_0.get_depth());
+ ^
+3 errors generated.
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm
new file mode 100644
index 0000000..bdb36a8
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fcac78 "textureDimensions_fcac78"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+%textureDimensions_fcac78 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %19
+ %16 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySize %v3int %16
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureDimensions_fcac78
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_fcac78
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_fcac78
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl
new file mode 100644
index 0000000..9d4ec34
--- /dev/null
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8uint>;
+
+fn textureDimensions_fcac78() {
+ var res : vec3<i32> = textureDimensions(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureDimensions_fcac78();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureDimensions_fcac78();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureDimensions_fcac78();
+}
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl
new file mode 100644
index 0000000..851d695
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32uint, read>;
+fn textureLoad_050c33() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_050c33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_050c33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_050c33();
+}
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl
new file mode 100644
index 0000000..8ffb8fe
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_050c33() {
+ uint4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_050c33();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_050c33();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_050c33();
+ return;
+}
+
+
+tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl
new file mode 100644
index 0000000..8342834
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_050c33() {
+ uint4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_050c33();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_050c33();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_050c33();
+ return;
+}
+
+
+tint_YLQCFG.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm
new file mode 100644
index 0000000..a51c315
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_050c33 "textureLoad_050c33"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_050c33 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_050c33
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_050c33
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_050c33
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl
new file mode 100644
index 0000000..3f9f0d4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32uint>;
+
+fn textureLoad_050c33() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_050c33();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_050c33();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_050c33();
+}
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl
new file mode 100644
index 0000000..db79f26
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, read>;
+fn textureLoad_072e26() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_072e26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_072e26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_072e26();
+}
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl
new file mode 100644
index 0000000..0df5e22
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_072e26() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_072e26();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_072e26();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_072e26();
+ return;
+}
+
+
+tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl
new file mode 100644
index 0000000..9bee2e9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_072e26() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_072e26();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_072e26();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_072e26();
+ return;
+}
+
+
+tint_JrhYNT.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm
new file mode 100644
index 0000000..0113514
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_072e26 "textureLoad_072e26"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_072e26 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_072e26
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_072e26
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_072e26
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl
new file mode 100644
index 0000000..2aa87e5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureLoad_072e26() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_072e26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_072e26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_072e26();
+}
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl
new file mode 100644
index 0000000..8d8dad3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8snorm, read>;
+fn textureLoad_078bc4() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_078bc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_078bc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_078bc4();
+}
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl
new file mode 100644
index 0000000..3c7fdbc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_078bc4() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+
+tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl
new file mode 100644
index 0000000..d5062a1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_078bc4() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_078bc4();
+ return;
+}
+
+
+tint_jjAKvY.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm
new file mode 100644
index 0000000..ecf39b1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_078bc4 "textureLoad_078bc4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_078bc4 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_078bc4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_078bc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_078bc4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl
new file mode 100644
index 0000000..b93303f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8snorm>;
+
+fn textureLoad_078bc4() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_078bc4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_078bc4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_078bc4();
+}
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl
new file mode 100644
index 0000000..8070e3c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, read>;
+fn textureLoad_127e12() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_127e12();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_127e12();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_127e12();
+}
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl
new file mode 100644
index 0000000..5683cc9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_127e12() {
+ uint4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_127e12();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_127e12();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_127e12();
+ return;
+}
+
+
+tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl
new file mode 100644
index 0000000..a996429
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_127e12() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_127e12();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_127e12();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_127e12();
+ return;
+}
+
+
+tint_cm9xwP.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm
new file mode 100644
index 0000000..8da1b2f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_127e12 "textureLoad_127e12"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_127e12 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %19
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_127e12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_127e12
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_127e12
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl
new file mode 100644
index 0000000..1890d11
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureLoad_127e12() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_127e12();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_127e12();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_127e12();
+}
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl
new file mode 100644
index 0000000..44c713e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32uint, read>;
+fn textureLoad_1561a7() {
+ var res: vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1561a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1561a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1561a7();
+}
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl
new file mode 100644
index 0000000..c571701
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_1561a7() {
+ uint4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_1561a7();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_1561a7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1561a7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl
new file mode 100644
index 0000000..56f5567
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1561a7() {
+ uint4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_1561a7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_1561a7();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_1561a7();
+ return;
+}
+
+
+tint_o82pOs.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm
new file mode 100644
index 0000000..aa226e0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1561a7 "textureLoad_1561a7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_1561a7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_1561a7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_1561a7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_1561a7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl
new file mode 100644
index 0000000..85e7bac
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32uint>;
+
+fn textureLoad_1561a7() {
+ var res : vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1561a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1561a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1561a7();
+}
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl
new file mode 100644
index 0000000..561eea2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+fn textureLoad_19cf87() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_19cf87();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_19cf87();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_19cf87();
+}
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl
new file mode 100644
index 0000000..9f700a7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl
@@ -0,0 +1,51 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D arg_0 : register(t0, space1);
+
+void textureLoad_19cf87() {
+ float res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+
+tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.Load(int3(0), 1);
+ ^
+tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.Load(int3(0), 1);
+ ^
+tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.Load(int3(0), 1);
+ ^
+tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl
new file mode 100644
index 0000000..94d4866
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_19cf87() {
+ float res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_19cf87();
+ return;
+}
+
+
+tint_AKv56M.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm
new file mode 100644
index 0000000..08cba67
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_19cf87 "textureLoad_19cf87"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureLoad_19cf87 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4float %15 %18 Lod %int_1
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_19cf87
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_19cf87
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_19cf87
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl
new file mode 100644
index 0000000..6170911
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+fn textureLoad_19cf87() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_19cf87();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_19cf87();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_19cf87();
+}
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl
new file mode 100644
index 0000000..4d030e7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, read>;
+fn textureLoad_1a062f() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1a062f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1a062f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1a062f();
+}
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl
new file mode 100644
index 0000000..61e5ce9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_1a062f() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+
+tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl
new file mode 100644
index 0000000..bb6c46b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1a062f() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_1a062f();
+ return;
+}
+
+
+tint_vRBu5V.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a98010
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1a062f "textureLoad_1a062f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1a062f = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_1a062f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_1a062f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_1a062f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl
new file mode 100644
index 0000000..81a3f1f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16float>;
+
+fn textureLoad_1a062f() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1a062f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1a062f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1a062f();
+}
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl
new file mode 100644
index 0000000..33f2e74
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8uint, read>;
+fn textureLoad_1a8452() {
+ var res: vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1a8452();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1a8452();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1a8452();
+}
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl
new file mode 100644
index 0000000..ca566ee
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_1a8452() {
+ uint4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_1a8452();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_1a8452();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1a8452();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl
new file mode 100644
index 0000000..6ecab82
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1a8452() {
+ uint4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_1a8452();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_1a8452();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_1a8452();
+ return;
+}
+
+
+tint_E0YZXD.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm
new file mode 100644
index 0000000..33cabbb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1a8452 "textureLoad_1a8452"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_1a8452 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_1a8452
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_1a8452
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_1a8452
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl
new file mode 100644
index 0000000..ac00f2b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8uint>;
+
+fn textureLoad_1a8452() {
+ var res : vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1a8452();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1a8452();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1a8452();
+}
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl
new file mode 100644
index 0000000..9f9aa3c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<u32>;
+fn textureLoad_1b8588() {
+ var res: vec4<u32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1b8588();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1b8588();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1b8588();
+}
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl
new file mode 100644
index 0000000..2839532
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_1b8588() {
+ uint4 res = arg_0.Load(int2(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_1b8588();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_1b8588();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1b8588();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl
new file mode 100644
index 0000000..afae3cf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1b8588() {
+ uint4 res = arg_0.read(1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_1b8588();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_1b8588();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_1b8588();
+ return;
+}
+
+
+tint_8clnPn.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm
new file mode 100644
index 0000000..bbb2eb8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1b8588 "textureLoad_1b8588"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_1b8588 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4uint %15 %int_1 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_1b8588
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_1b8588
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_1b8588
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl
new file mode 100644
index 0000000..643b291
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<u32>;
+
+fn textureLoad_1b8588() {
+ var res : vec4<u32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1b8588();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1b8588();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1b8588();
+}
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl
new file mode 100644
index 0000000..9203100
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+fn textureLoad_1f2016() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1f2016();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1f2016();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1f2016();
+}
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl
new file mode 100644
index 0000000..e6296a1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_1f2016() {
+ float4 res = arg_0.Load(int4(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+
+tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl
new file mode 100644
index 0000000..a1422f8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1f2016() {
+ float4 res = arg_0.read(int3(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_1f2016();
+ return;
+}
+
+
+tint_PZhzf3.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm
new file mode 100644
index 0000000..e619f07
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_1f2016 "textureLoad_1f2016"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1f2016 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %17 Lod %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_1f2016
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_1f2016
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_1f2016
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl
new file mode 100644
index 0000000..94202f9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+fn textureLoad_1f2016() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_1f2016();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_1f2016();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_1f2016();
+}
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl
new file mode 100644
index 0000000..3ea6735
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, read>;
+fn textureLoad_20fa2f() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_20fa2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_20fa2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_20fa2f();
+}
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl
new file mode 100644
index 0000000..62fc6aa
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_20fa2f() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+
+tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl
new file mode 100644
index 0000000..fecc8ce
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_20fa2f() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_20fa2f();
+ return;
+}
+
+
+tint_laj3aH.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm
new file mode 100644
index 0000000..ae7ed4a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_20fa2f "textureLoad_20fa2f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_20fa2f = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_20fa2f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_20fa2f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_20fa2f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef0765a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32float>;
+
+fn textureLoad_20fa2f() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_20fa2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_20fa2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_20fa2f();
+}
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl
new file mode 100644
index 0000000..8a841e7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32uint, read>;
+fn textureLoad_276a2c() {
+ var res: vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_276a2c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_276a2c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_276a2c();
+}
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl
new file mode 100644
index 0000000..1e7103a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_276a2c() {
+ uint4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_276a2c();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_276a2c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_276a2c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl
new file mode 100644
index 0000000..7632467
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_276a2c() {
+ uint4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_276a2c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_276a2c();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_276a2c();
+ return;
+}
+
+
+tint_d2GdWr.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm
new file mode 100644
index 0000000..fa97693
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_276a2c "textureLoad_276a2c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_276a2c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_276a2c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_276a2c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_276a2c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl
new file mode 100644
index 0000000..b8110cd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32uint>;
+
+fn textureLoad_276a2c() {
+ var res : vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_276a2c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_276a2c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_276a2c();
+}
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl
new file mode 100644
index 0000000..1f2018c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32float, read>;
+fn textureLoad_2887d7() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2887d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2887d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2887d7();
+}
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl
new file mode 100644
index 0000000..b3b3d1e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_2887d7() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_2887d7();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_2887d7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2887d7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl
new file mode 100644
index 0000000..452af57
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_2887d7() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_2887d7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_2887d7();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_2887d7();
+ return;
+}
+
+
+tint_Woie28.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm
new file mode 100644
index 0000000..8a626fd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_2887d7 "textureLoad_2887d7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_2887d7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_2887d7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_2887d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_2887d7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl
new file mode 100644
index 0000000..fdcb0fd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32float>;
+
+fn textureLoad_2887d7() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2887d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2887d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2887d7();
+}
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl
new file mode 100644
index 0000000..6f9958f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16sint, read>;
+fn textureLoad_2ae485() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2ae485();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2ae485();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2ae485();
+}
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl
new file mode 100644
index 0000000..469640f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_2ae485() {
+ int4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+
+tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl
new file mode 100644
index 0000000..3844142
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_2ae485() {
+ int4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_2ae485();
+ return;
+}
+
+
+tint_bpTyQu.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm
new file mode 100644
index 0000000..017de96
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_2ae485 "textureLoad_2ae485"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_2ae485 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_2ae485
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_2ae485
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_2ae485
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl
new file mode 100644
index 0000000..c15430e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16sint>;
+
+fn textureLoad_2ae485() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2ae485();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2ae485();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2ae485();
+}
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl
new file mode 100644
index 0000000..c04b9f5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32sint, read>;
+fn textureLoad_2d6cf7() {
+ var res: vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2d6cf7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2d6cf7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2d6cf7();
+}
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl
new file mode 100644
index 0000000..b747bda
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_2d6cf7() {
+ int4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl
new file mode 100644
index 0000000..9395679
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_2d6cf7() {
+ int4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_2d6cf7();
+ return;
+}
+
+
+tint_UsuKLT.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm
new file mode 100644
index 0000000..dc72114
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_2d6cf7 "textureLoad_2d6cf7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_2d6cf7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_2d6cf7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_2d6cf7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_2d6cf7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl
new file mode 100644
index 0000000..1ada169
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32sint>;
+
+fn textureLoad_2d6cf7() {
+ var res : vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_2d6cf7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_2d6cf7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_2d6cf7();
+}
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl
new file mode 100644
index 0000000..eccc28c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8uint, read>;
+fn textureLoad_3c0d9e() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3c0d9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3c0d9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3c0d9e();
+}
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl
new file mode 100644
index 0000000..4c4475b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_3c0d9e() {
+ uint4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+
+tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl
new file mode 100644
index 0000000..89d32a1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3c0d9e() {
+ uint4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_3c0d9e();
+ return;
+}
+
+
+tint_RbcsGC.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm
new file mode 100644
index 0000000..0dee741
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3c0d9e "textureLoad_3c0d9e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_3c0d9e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_3c0d9e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_3c0d9e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_3c0d9e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl
new file mode 100644
index 0000000..36608fe
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8uint>;
+
+fn textureLoad_3c0d9e() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3c0d9e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3c0d9e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3c0d9e();
+}
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl
new file mode 100644
index 0000000..9d4616b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8unorm, read>;
+fn textureLoad_3c9587() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3c9587();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3c9587();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3c9587();
+}
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl
new file mode 100644
index 0000000..9670a67
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3c9587() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+
+tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl
new file mode 100644
index 0000000..60712e6
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3c9587() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_3c9587();
+ return;
+}
+
+
+tint_LgFWEE.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm
new file mode 100644
index 0000000..a209011
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3c9587 "textureLoad_3c9587"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3c9587 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_3c9587
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_3c9587
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_3c9587
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl
new file mode 100644
index 0000000..887771f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
+
+fn textureLoad_3c9587() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3c9587();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3c9587();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3c9587();
+}
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl
new file mode 100644
index 0000000..5c663cd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8sint, read>;
+fn textureLoad_3d001b() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3d001b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3d001b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3d001b();
+}
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl
new file mode 100644
index 0000000..5672bad
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_3d001b() {
+ int4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+
+tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl
new file mode 100644
index 0000000..d55d6ac
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3d001b() {
+ int4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_3d001b();
+ return;
+}
+
+
+tint_OhK8qo.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm
new file mode 100644
index 0000000..61dba8e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3d001b "textureLoad_3d001b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_3d001b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_3d001b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_3d001b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_3d001b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl
new file mode 100644
index 0000000..3ef3d15
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8sint>;
+
+fn textureLoad_3d001b() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3d001b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3d001b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3d001b();
+}
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl
new file mode 100644
index 0000000..09e6ede
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32float, read>;
+fn textureLoad_3d9c90() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3d9c90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3d9c90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3d9c90();
+}
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl
new file mode 100644
index 0000000..23429ff
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_3d9c90() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+
+tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl
new file mode 100644
index 0000000..737e626
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3d9c90() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_3d9c90();
+ return;
+}
+
+
+tint_jsl4ld.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm
new file mode 100644
index 0000000..b41a433
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_3d9c90 "textureLoad_3d9c90"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3d9c90 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_3d9c90
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_3d9c90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_3d9c90
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl
new file mode 100644
index 0000000..546b4dc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32float>;
+
+fn textureLoad_3d9c90() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_3d9c90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_3d9c90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_3d9c90();
+}
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl
new file mode 100644
index 0000000..941c5c1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+fn textureLoad_484344() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_484344();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_484344();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_484344();
+}
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl
new file mode 100644
index 0000000..37936dc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_484344() {
+ float4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_484344();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_484344();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_484344();
+ return;
+}
+
+
+tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl
new file mode 100644
index 0000000..9d40169
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_484344() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_484344();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_484344();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_484344();
+ return;
+}
+
+
+tint_kMAwof.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm
new file mode 100644
index 0000000..083475d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_484344 "textureLoad_484344"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_484344 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %17 Lod %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_484344
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_484344
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_484344
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl
new file mode 100644
index 0000000..8776b0a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+fn textureLoad_484344() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_484344();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_484344();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_484344();
+}
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl
new file mode 100644
index 0000000..747d2ad
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<i32>;
+fn textureLoad_4fd803() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_4fd803();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_4fd803();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_4fd803();
+}
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl
new file mode 100644
index 0000000..83cfe48
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_4fd803() {
+ int4 res = arg_0.Load(int4(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+
+tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl
new file mode 100644
index 0000000..3d1c4ce
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_4fd803() {
+ int4 res = arg_0.read(int3(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_4fd803();
+ return;
+}
+
+
+tint_LFK7PX.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm
new file mode 100644
index 0000000..8ca0c65
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_4fd803 "textureLoad_4fd803"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_4fd803 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4int %15 %17 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_4fd803
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_4fd803
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_4fd803
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl
new file mode 100644
index 0000000..6bea105
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<i32>;
+
+fn textureLoad_4fd803() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_4fd803();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_4fd803();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_4fd803();
+}
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl
new file mode 100644
index 0000000..476e534
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32sint, read>;
+fn textureLoad_505aa2() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_505aa2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_505aa2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_505aa2();
+}
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl
new file mode 100644
index 0000000..a15566d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_505aa2() {
+ int4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+
+tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl
new file mode 100644
index 0000000..afbf77b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_505aa2() {
+ int4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_505aa2();
+ return;
+}
+
+
+tint_B775lh.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm
new file mode 100644
index 0000000..799937e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_505aa2 "textureLoad_505aa2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_505aa2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_505aa2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_505aa2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_505aa2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl
new file mode 100644
index 0000000..380f1f9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32sint>;
+
+fn textureLoad_505aa2() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_505aa2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_505aa2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_505aa2();
+}
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl
new file mode 100644
index 0000000..018941a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8unorm, read>;
+fn textureLoad_519ab5() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_519ab5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_519ab5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_519ab5();
+}
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl
new file mode 100644
index 0000000..2a8f26b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_519ab5() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_519ab5();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_519ab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_519ab5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl
new file mode 100644
index 0000000..e9a10b5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_519ab5() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_519ab5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_519ab5();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_519ab5();
+ return;
+}
+
+
+tint_ApSVcX.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6afde50
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_519ab5 "textureLoad_519ab5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_519ab5 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_519ab5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_519ab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_519ab5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl
new file mode 100644
index 0000000..2135d0d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8unorm>;
+
+fn textureLoad_519ab5() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_519ab5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_519ab5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_519ab5();
+}
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl
new file mode 100644
index 0000000..7b22635
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32sint, read>;
+fn textureLoad_53378a() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_53378a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_53378a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_53378a();
+}
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl
new file mode 100644
index 0000000..23334b1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_53378a() {
+ int4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_53378a();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_53378a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_53378a();
+ return;
+}
+
+
+tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl
new file mode 100644
index 0000000..6014dee
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_53378a() {
+ int4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_53378a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_53378a();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_53378a();
+ return;
+}
+
+
+tint_xZcA0b.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm
new file mode 100644
index 0000000..b916b86
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_53378a "textureLoad_53378a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_53378a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_53378a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_53378a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_53378a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl
new file mode 100644
index 0000000..0310fa3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32sint>;
+
+fn textureLoad_53378a() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_53378a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_53378a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_53378a();
+}
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl
new file mode 100644
index 0000000..172dccd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, read>;
+fn textureLoad_560573() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_560573();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_560573();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_560573();
+}
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl
new file mode 100644
index 0000000..1e7d2fb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_560573() {
+ int4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_560573();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_560573();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_560573();
+ return;
+}
+
+
+tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl
new file mode 100644
index 0000000..0eb8674
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_560573() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_560573();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_560573();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_560573();
+ return;
+}
+
+
+tint_cktG5W.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm
new file mode 100644
index 0000000..c8598fb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_560573 "textureLoad_560573"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_560573 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_560573
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_560573
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_560573
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a6f48e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32sint>;
+
+fn textureLoad_560573() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_560573();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_560573();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_560573();
+}
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl
new file mode 100644
index 0000000..07d3370
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, read>;
+fn textureLoad_582015() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_582015();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_582015();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_582015();
+}
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl
new file mode 100644
index 0000000..a9bb487
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_582015() {
+ int4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_582015();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_582015();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_582015();
+ return;
+}
+
+
+tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl
new file mode 100644
index 0000000..b64322d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_582015() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_582015();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_582015();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_582015();
+ return;
+}
+
+
+tint_qpBH7K.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm
new file mode 100644
index 0000000..8fe9100
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_582015 "textureLoad_582015"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_582015 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_582015
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_582015
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_582015
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl
new file mode 100644
index 0000000..21b6237
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureLoad_582015() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_582015();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_582015();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_582015();
+}
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl
new file mode 100644
index 0000000..1b876ab
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<i32>;
+fn textureLoad_5a2f9d() {
+ var res: vec4<i32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5a2f9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5a2f9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5a2f9d();
+}
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl
new file mode 100644
index 0000000..2d4ad36
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_5a2f9d() {
+ int4 res = arg_0.Load(int2(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl
new file mode 100644
index 0000000..6ed398f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5a2f9d() {
+ int4 res = arg_0.read(1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_5a2f9d();
+ return;
+}
+
+
+tint_CRtFdW.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm
new file mode 100644
index 0000000..82ae564
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_5a2f9d "textureLoad_5a2f9d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_5a2f9d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4int %15 %int_1 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_5a2f9d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_5a2f9d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_5a2f9d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl
new file mode 100644
index 0000000..22da997
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<i32>;
+
+fn textureLoad_5a2f9d() {
+ var res : vec4<i32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5a2f9d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5a2f9d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5a2f9d();
+}
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl
new file mode 100644
index 0000000..a698444
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32uint, read>;
+fn textureLoad_5bb7fb() {
+ var res: vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5bb7fb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5bb7fb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5bb7fb();
+}
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl
new file mode 100644
index 0000000..82ce725
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_5bb7fb() {
+ uint4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl
new file mode 100644
index 0000000..b0e3ec0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5bb7fb() {
+ uint4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_5bb7fb();
+ return;
+}
+
+
+tint_7znWmf.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm
new file mode 100644
index 0000000..e82fd45
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_5bb7fb "textureLoad_5bb7fb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_5bb7fb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_5bb7fb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_5bb7fb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_5bb7fb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl
new file mode 100644
index 0000000..9336c2d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32uint>;
+
+fn textureLoad_5bb7fb() {
+ var res : vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5bb7fb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5bb7fb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5bb7fb();
+}
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl
new file mode 100644
index 0000000..605696e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, read>;
+fn textureLoad_5d0a2f() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5d0a2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5d0a2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5d0a2f();
+}
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl
new file mode 100644
index 0000000..28e0438
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_5d0a2f() {
+ uint4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+
+tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl
new file mode 100644
index 0000000..8b91729
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5d0a2f() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_5d0a2f();
+ return;
+}
+
+
+tint_hkcUe3.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm
new file mode 100644
index 0000000..6bf1faa
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_5d0a2f "textureLoad_5d0a2f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_5d0a2f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %19
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_5d0a2f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_5d0a2f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_5d0a2f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl
new file mode 100644
index 0000000..57d879a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32uint>;
+
+fn textureLoad_5d0a2f() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_5d0a2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_5d0a2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_5d0a2f();
+}
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl
new file mode 100644
index 0000000..4cffca1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<u32>;
+fn textureLoad_6154d4() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_6154d4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_6154d4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_6154d4();
+}
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl
new file mode 100644
index 0000000..5642481
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_6154d4() {
+ uint4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+
+tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl
new file mode 100644
index 0000000..2adcb35
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6154d4() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_6154d4();
+ return;
+}
+
+
+tint_i3aA5Y.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm
new file mode 100644
index 0000000..c9b3a24
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_6154d4 "textureLoad_6154d4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_6154d4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4uint %15 %18 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_6154d4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_6154d4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_6154d4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl
new file mode 100644
index 0000000..21aa49a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<u32>;
+
+fn textureLoad_6154d4() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_6154d4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_6154d4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_6154d4();
+}
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl
new file mode 100644
index 0000000..c3e1ed0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8snorm, read>;
+fn textureLoad_62d125() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_62d125();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_62d125();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_62d125();
+}
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl
new file mode 100644
index 0000000..9a9a6cf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_62d125() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_62d125();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_62d125();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_62d125();
+ return;
+}
+
+
+tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl
new file mode 100644
index 0000000..9e5a3c1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_62d125() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_62d125();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_62d125();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_62d125();
+ return;
+}
+
+
+tint_7Etnvc.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm
new file mode 100644
index 0000000..34ab6f8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_62d125 "textureLoad_62d125"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_62d125 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_62d125
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_62d125
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_62d125
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl
new file mode 100644
index 0000000..1035db6
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8snorm>;
+
+fn textureLoad_62d125() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_62d125();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_62d125();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_62d125();
+}
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl
new file mode 100644
index 0000000..d862939
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16sint, read>;
+fn textureLoad_6678b6() {
+ var res: vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_6678b6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_6678b6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_6678b6();
+}
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl
new file mode 100644
index 0000000..c412e7c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_6678b6() {
+ int4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_6678b6();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_6678b6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6678b6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl
new file mode 100644
index 0000000..cbfb396
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6678b6() {
+ int4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_6678b6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_6678b6();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_6678b6();
+ return;
+}
+
+
+tint_jYZ5PL.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0098ed
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_6678b6 "textureLoad_6678b6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_6678b6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_6678b6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_6678b6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_6678b6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl
new file mode 100644
index 0000000..65efde1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16sint>;
+
+fn textureLoad_6678b6() {
+ var res : vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_6678b6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_6678b6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_6678b6();
+}
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl
new file mode 100644
index 0000000..934f632
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32uint, read>;
+fn textureLoad_67edca() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_67edca();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_67edca();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_67edca();
+}
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl
new file mode 100644
index 0000000..709ab83
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_67edca() {
+ uint4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_67edca();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_67edca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_67edca();
+ return;
+}
+
+
+tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl
new file mode 100644
index 0000000..ead27c9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_67edca() {
+ uint4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_67edca();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_67edca();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_67edca();
+ return;
+}
+
+
+tint_6fwyP5.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm
new file mode 100644
index 0000000..5e13182
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_67edca "textureLoad_67edca"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_67edca = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_67edca
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_67edca
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_67edca
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl
new file mode 100644
index 0000000..48f60e9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32uint>;
+
+fn textureLoad_67edca() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_67edca();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_67edca();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_67edca();
+}
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl
new file mode 100644
index 0000000..ecb0e5c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32uint, read>;
+fn textureLoad_749704() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_749704();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_749704();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_749704();
+}
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl
new file mode 100644
index 0000000..2c3d946
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_749704() {
+ uint4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_749704();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_749704();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_749704();
+ return;
+}
+
+
+tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl
new file mode 100644
index 0000000..ef756da
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_749704() {
+ uint4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_749704();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_749704();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_749704();
+ return;
+}
+
+
+tint_h41DHl.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm
new file mode 100644
index 0000000..9826b95
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_749704 "textureLoad_749704"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_749704 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_749704
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_749704
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_749704
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl
new file mode 100644
index 0000000..ac72def
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32uint>;
+
+fn textureLoad_749704() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_749704();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_749704();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_749704();
+}
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl
new file mode 100644
index 0000000..2beff2a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<i32>;
+fn textureLoad_79e697() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_79e697();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_79e697();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_79e697();
+}
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl
new file mode 100644
index 0000000..1cddd6c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_79e697() {
+ int4 res = arg_0.Load(int4(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_79e697();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_79e697();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_79e697();
+ return;
+}
+
+
+tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl
new file mode 100644
index 0000000..a592ca7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_79e697() {
+ int4 res = arg_0.read(int2(), 1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_79e697();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_79e697();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_79e697();
+ return;
+}
+
+
+tint_0CahWp.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d05eba
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_79e697 "textureLoad_79e697"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_79e697 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4int %15 %18 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_79e697
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_79e697
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_79e697
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl
new file mode 100644
index 0000000..f22e4e2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<i32>;
+
+fn textureLoad_79e697() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_79e697();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_79e697();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_79e697();
+}
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl
new file mode 100644
index 0000000..c45502f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<u32>;
+fn textureLoad_7c90e5() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_7c90e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_7c90e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_7c90e5();
+}
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl
new file mode 100644
index 0000000..de8c82e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_7c90e5() {
+ uint4 res = arg_0.Load(int4(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+
+tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl
new file mode 100644
index 0000000..add45a9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7c90e5() {
+ uint4 res = arg_0.read(int2(), 1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_7c90e5();
+ return;
+}
+
+
+tint_cSpOsM.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm
new file mode 100644
index 0000000..3446266
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_7c90e5 "textureLoad_7c90e5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_7c90e5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4uint %15 %19 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_7c90e5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_7c90e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_7c90e5
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl
new file mode 100644
index 0000000..e5ebce3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<u32>;
+
+fn textureLoad_7c90e5() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_7c90e5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_7c90e5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_7c90e5();
+}
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl
new file mode 100644
index 0000000..8d1b0cb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<f32>;
+fn textureLoad_81c381() {
+ var res: vec4<f32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_81c381();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_81c381();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_81c381();
+}
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl
new file mode 100644
index 0000000..fdca8d1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_81c381() {
+ float4 res = arg_0.Load(int2(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_81c381();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_81c381();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_81c381();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl
new file mode 100644
index 0000000..b244c3a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_81c381() {
+ float4 res = arg_0.read(1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_81c381();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_81c381();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_81c381();
+ return;
+}
+
+
+tint_w456fy.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm
new file mode 100644
index 0000000..b5702bb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_81c381 "textureLoad_81c381"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_81c381 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %int_1 Lod %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_81c381
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_81c381
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_81c381
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl
new file mode 100644
index 0000000..458368b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<f32>;
+
+fn textureLoad_81c381() {
+ var res : vec4<f32> = textureLoad(arg_0, 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_81c381();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_81c381();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_81c381();
+}
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl
new file mode 100644
index 0000000..097007a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16uint, read>;
+fn textureLoad_83cea4() {
+ var res: vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_83cea4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_83cea4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_83cea4();
+}
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl
new file mode 100644
index 0000000..decc049
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_83cea4() {
+ uint4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_83cea4();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_83cea4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_83cea4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl
new file mode 100644
index 0000000..59a2bca
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_83cea4() {
+ uint4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_83cea4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_83cea4();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_83cea4();
+ return;
+}
+
+
+tint_7kpW9b.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm
new file mode 100644
index 0000000..73bb99c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_83cea4 "textureLoad_83cea4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_83cea4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_83cea4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_83cea4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_83cea4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl
new file mode 100644
index 0000000..04820c2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16uint>;
+
+fn textureLoad_83cea4() {
+ var res : vec4<u32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_83cea4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_83cea4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_83cea4();
+}
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl
new file mode 100644
index 0000000..0ce5ed9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+fn textureLoad_87be85() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_87be85();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_87be85();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_87be85();
+}
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl
new file mode 100644
index 0000000..477020c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_87be85() {
+ float4 res = arg_0.Load(int4(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_87be85();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_87be85();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_87be85();
+ return;
+}
+
+
+tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl
new file mode 100644
index 0000000..ea04620
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_87be85() {
+ float4 res = arg_0.read(int2(), 1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_87be85();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_87be85();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_87be85();
+ return;
+}
+
+
+tint_8RPPdu.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm
new file mode 100644
index 0000000..66cb0c8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_87be85 "textureLoad_87be85"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_87be85 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %18 Lod %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_87be85
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_87be85
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_87be85
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl
new file mode 100644
index 0000000..5029fff
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+fn textureLoad_87be85() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_87be85();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_87be85();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_87be85();
+}
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl
new file mode 100644
index 0000000..f5e787e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_external;
+fn textureLoad_8acf41() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_8acf41();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_8acf41();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_8acf41();
+}
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl
new file mode 100644
index 0000000..dd3ce78
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_8acf41() {
+ float4 res = arg_0.Load(int3(0), 0);
+}
+
+void vertex_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+
+tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 0);
+ ^
+
+
+tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 0);
+ ^
+
+
+tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl
new file mode 100644
index 0000000..1419abf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_8acf41() {
+ float4 res = arg_0.read(int2(), 0);
+}
+
+vertex void vertex_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_8acf41();
+ return;
+}
+
+
+tint_olJAtB.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 0);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm
new file mode 100644
index 0000000..c639aff
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_8acf41 "textureLoad_8acf41"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_8acf41 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %17 Lod %int_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_8acf41
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_8acf41
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_8acf41
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl
new file mode 100644
index 0000000..fc9278e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : external_texture;
+
+fn textureLoad_8acf41() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_8acf41();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_8acf41();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_8acf41();
+}
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl
new file mode 100644
index 0000000..16885de
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, read>;
+fn textureLoad_8e5032() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_8e5032();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_8e5032();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_8e5032();
+}
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl
new file mode 100644
index 0000000..5e873e1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_8e5032() {
+ uint4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+
+tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl
new file mode 100644
index 0000000..42a75d7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_8e5032() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_8e5032();
+ return;
+}
+
+
+tint_N2THrH.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm
new file mode 100644
index 0000000..53582a8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_8e5032 "textureLoad_8e5032"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_8e5032 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %19
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_8e5032
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_8e5032
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_8e5032
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl
new file mode 100644
index 0000000..e3d7995
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32uint>;
+
+fn textureLoad_8e5032() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_8e5032();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_8e5032();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_8e5032();
+}
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl
new file mode 100644
index 0000000..8354199
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, read>;
+fn textureLoad_936952() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_936952();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_936952();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_936952();
+}
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl
new file mode 100644
index 0000000..2009c30
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_936952() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_936952();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_936952();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_936952();
+ return;
+}
+
+
+tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl
new file mode 100644
index 0000000..211f973
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_936952() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_936952();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_936952();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_936952();
+ return;
+}
+
+
+tint_Cky0g4.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm
new file mode 100644
index 0000000..413f85a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_936952 "textureLoad_936952"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_936952 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_936952
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_936952
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_936952
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl
new file mode 100644
index 0000000..618a8cf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32float>;
+
+fn textureLoad_936952() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_936952();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_936952();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_936952();
+}
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl
new file mode 100644
index 0000000..6d893bb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8uint, read>;
+fn textureLoad_9a7c90() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9a7c90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9a7c90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9a7c90();
+}
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl
new file mode 100644
index 0000000..c889dba
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_9a7c90() {
+ uint4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+
+tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl
new file mode 100644
index 0000000..3e6872e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9a7c90() {
+ uint4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_9a7c90();
+ return;
+}
+
+
+tint_UQd2nQ.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm
new file mode 100644
index 0000000..3e11609
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9a7c90 "textureLoad_9a7c90"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_9a7c90 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_9a7c90
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_9a7c90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_9a7c90
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl
new file mode 100644
index 0000000..99b2bda
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8uint>;
+
+fn textureLoad_9a7c90() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9a7c90();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9a7c90();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9a7c90();
+}
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl
new file mode 100644
index 0000000..a204e9d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d_array;
+fn textureLoad_9b2667() {
+ var res: f32 = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9b2667();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9b2667();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9b2667();
+}
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl
new file mode 100644
index 0000000..b94ff9a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureLoad_9b2667() {
+ float res = arg_0.Load(int4(1, 0), 1);
+}
+
+void vertex_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+
+tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float res = arg_0.Load(int4(1, 0), 1);
+ ^
+
+
+tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float res = arg_0.Load(int4(1, 0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl
new file mode 100644
index 0000000..9eb5e24
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9b2667() {
+ float res = arg_0.read(int2(), 1, 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_9b2667();
+ return;
+}
+
+
+tint_t9cZ5X.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.read(int2(), 1, 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm
new file mode 100644
index 0000000..e342e2c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9b2667 "textureLoad_9b2667"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureLoad_9b2667 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4float %15 %19 Lod %int_1
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_9b2667
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_9b2667
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_9b2667
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl
new file mode 100644
index 0000000..aa5e716
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+fn textureLoad_9b2667() {
+ var res : f32 = textureLoad(arg_0, vec2<i32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9b2667();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9b2667();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9b2667();
+}
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl
new file mode 100644
index 0000000..cf25b4b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32float, read>;
+fn textureLoad_9c2a14() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9c2a14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9c2a14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9c2a14();
+}
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl
new file mode 100644
index 0000000..4768d80
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_9c2a14() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+
+tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl
new file mode 100644
index 0000000..9fa3c70
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_9c2a14() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_9c2a14();
+ return;
+}
+
+
+tint_XqayFJ.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm
new file mode 100644
index 0000000..895e3cd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_9c2a14 "textureLoad_9c2a14"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_9c2a14 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_9c2a14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_9c2a14
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_9c2a14
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl
new file mode 100644
index 0000000..fdd5a28
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rg32float>;
+
+fn textureLoad_9c2a14() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_9c2a14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_9c2a14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_9c2a14();
+}
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl
new file mode 100644
index 0000000..6b503a3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<f32>;
+fn textureLoad_a583c9() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a583c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a583c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a583c9();
+}
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl
new file mode 100644
index 0000000..d0e08b5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl
@@ -0,0 +1,51 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureLoad_a583c9() {
+ float4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+
+tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion]
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion]
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion]
+ float4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl
new file mode 100644
index 0000000..72ba5fb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a583c9() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_a583c9();
+ return;
+}
+
+
+tint_0WA0ve.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..d1d4806
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a583c9 "textureLoad_a583c9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_a583c9 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageFetch %v4float %14 %17 Sample %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_a583c9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_a583c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_a583c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..0eb7d2f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureLoad_a583c9() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a583c9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a583c9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a583c9();
+}
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl
new file mode 100644
index 0000000..1c7be46
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8unorm, read>;
+fn textureLoad_a6a85a() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a6a85a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a6a85a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a6a85a();
+}
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl
new file mode 100644
index 0000000..18e1fee
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_a6a85a() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+
+tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl
new file mode 100644
index 0000000..81c2d07
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a6a85a() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_a6a85a();
+ return;
+}
+
+
+tint_MZOSDo.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm
new file mode 100644
index 0000000..43cd94e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a6a85a "textureLoad_a6a85a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_a6a85a = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_a6a85a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_a6a85a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_a6a85a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl
new file mode 100644
index 0000000..89dc933
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba8unorm>;
+
+fn textureLoad_a6a85a() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a6a85a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a6a85a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a6a85a();
+}
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl
new file mode 100644
index 0000000..52c4f5f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, read>;
+fn textureLoad_a6b61d() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a6b61d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a6b61d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a6b61d();
+}
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl
new file mode 100644
index 0000000..b9d20ed
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_a6b61d() {
+ int4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+
+tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl
new file mode 100644
index 0000000..741e9d0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a6b61d() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_a6b61d();
+ return;
+}
+
+
+tint_MCK3GD.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm
new file mode 100644
index 0000000..3d2357a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a6b61d "textureLoad_a6b61d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_a6b61d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_a6b61d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_a6b61d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_a6b61d
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl
new file mode 100644
index 0000000..a3e6393
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureLoad_a6b61d() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a6b61d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a6b61d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a6b61d();
+}
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl
new file mode 100644
index 0000000..42d9f0b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16sint, read>;
+fn textureLoad_a7a3c3() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a7a3c3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a7a3c3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a7a3c3();
+}
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl
new file mode 100644
index 0000000..66f97b3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_a7a3c3() {
+ int4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+
+tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl
new file mode 100644
index 0000000..04e3168
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a7a3c3() {
+ int4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_a7a3c3();
+ return;
+}
+
+
+tint_rFvCL7.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b068e66
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a7a3c3 "textureLoad_a7a3c3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_a7a3c3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_a7a3c3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_a7a3c3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_a7a3c3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl
new file mode 100644
index 0000000..d6ad3c5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16sint>;
+
+fn textureLoad_a7a3c3() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a7a3c3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a7a3c3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a7a3c3();
+}
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl
new file mode 100644
index 0000000..a2861bf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<u32>;
+fn textureLoad_a9a9f5() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a9a9f5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a9a9f5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a9a9f5();
+}
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl
new file mode 100644
index 0000000..1a77cc1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_a9a9f5() {
+ uint4 res = arg_0.Load(int4(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+
+tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0), 1);
+ ^
+
+
+tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl
new file mode 100644
index 0000000..c734143
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_a9a9f5() {
+ uint4 res = arg_0.read(int3(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_a9a9f5();
+ return;
+}
+
+
+tint_XRA6On.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm
new file mode 100644
index 0000000..83b174d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_a9a9f5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4uint %15 %18 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_a9a9f5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_a9a9f5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_a9a9f5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl
new file mode 100644
index 0000000..5a07216
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<u32>;
+
+fn textureLoad_a9a9f5() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_a9a9f5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_a9a9f5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_a9a9f5();
+}
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl
new file mode 100644
index 0000000..9bdf759
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32sint, read>;
+fn textureLoad_b1bf79() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b1bf79();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b1bf79();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b1bf79();
+}
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl
new file mode 100644
index 0000000..ef7bcdf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_b1bf79() {
+ int4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+
+tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl
new file mode 100644
index 0000000..a94e96b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b1bf79() {
+ int4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_b1bf79();
+ return;
+}
+
+
+tint_YXVObw.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm
new file mode 100644
index 0000000..168c98a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b1bf79 "textureLoad_b1bf79"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_b1bf79 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_b1bf79
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_b1bf79
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_b1bf79
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl
new file mode 100644
index 0000000..c722eb3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba32sint>;
+
+fn textureLoad_b1bf79() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b1bf79();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b1bf79();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b1bf79();
+}
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl
new file mode 100644
index 0000000..60239d0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, read>;
+fn textureLoad_b58c6d() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b58c6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b58c6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b58c6d();
+}
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl
new file mode 100644
index 0000000..5ee3586
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_b58c6d() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+
+tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl
new file mode 100644
index 0000000..24d5f49
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b58c6d() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_b58c6d();
+ return;
+}
+
+
+tint_l0fo2E.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm
new file mode 100644
index 0000000..666c185
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b58c6d "textureLoad_b58c6d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_b58c6d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_b58c6d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_b58c6d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_b58c6d
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl
new file mode 100644
index 0000000..4f945bc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32float>;
+
+fn textureLoad_b58c6d() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b58c6d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b58c6d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b58c6d();
+}
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl
new file mode 100644
index 0000000..3989081
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32uint, read>;
+fn textureLoad_b6c458() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b6c458();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b6c458();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b6c458();
+}
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl
new file mode 100644
index 0000000..773c1c3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_b6c458() {
+ uint4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+
+tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl
new file mode 100644
index 0000000..05acd49
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_b6c458() {
+ uint4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_b6c458();
+ return;
+}
+
+
+tint_VddxXh.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm
new file mode 100644
index 0000000..40a4ccb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_b6c458 "textureLoad_b6c458"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_b6c458 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_b6c458
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_b6c458
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_b6c458
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl
new file mode 100644
index 0000000..317bcc4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32uint>;
+
+fn textureLoad_b6c458() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_b6c458();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_b6c458();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_b6c458();
+}
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl
new file mode 100644
index 0000000..0ae454d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32uint, read>;
+fn textureLoad_bfd154() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_bfd154();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_bfd154();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_bfd154();
+}
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl
new file mode 100644
index 0000000..89f908b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_bfd154() {
+ uint4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+
+tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl
new file mode 100644
index 0000000..b24fd26
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_bfd154() {
+ uint4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_bfd154();
+ return;
+}
+
+
+tint_s46SKh.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm
new file mode 100644
index 0000000..5fe780f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_bfd154 "textureLoad_bfd154"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_bfd154 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_bfd154
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_bfd154
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_bfd154
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl
new file mode 100644
index 0000000..45d2471
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32uint>;
+
+fn textureLoad_bfd154() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_bfd154();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_bfd154();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_bfd154();
+}
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl
new file mode 100644
index 0000000..88beec8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16float, read>;
+fn textureLoad_c02b74() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c02b74();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c02b74();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c02b74();
+}
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl
new file mode 100644
index 0000000..0260e3b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_c02b74() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_c02b74();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c02b74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c02b74();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl
new file mode 100644
index 0000000..5e004de
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c02b74() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c02b74();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c02b74();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c02b74();
+ return;
+}
+
+
+tint_plnP7W.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm
new file mode 100644
index 0000000..79294d5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c02b74 "textureLoad_c02b74"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_c02b74 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_c02b74
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_c02b74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_c02b74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl
new file mode 100644
index 0000000..82ce81a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba16float>;
+
+fn textureLoad_c02b74() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c02b74();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c02b74();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c02b74();
+}
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl
new file mode 100644
index 0000000..7fea1e2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32float, read>;
+fn textureLoad_c07013() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c07013();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c07013();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c07013();
+}
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl
new file mode 100644
index 0000000..f46158a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_c07013() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_c07013();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c07013();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c07013();
+ return;
+}
+
+
+tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl
new file mode 100644
index 0000000..6fa3857
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c07013() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_c07013();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c07013();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c07013();
+ return;
+}
+
+
+tint_uSEFIK.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm
new file mode 100644
index 0000000..1ac9c62
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c07013 "textureLoad_c07013"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_c07013 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_c07013
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_c07013
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_c07013
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl
new file mode 100644
index 0000000..4d58718
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32float>;
+
+fn textureLoad_c07013() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c07013();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c07013();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c07013();
+}
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl
new file mode 100644
index 0000000..2736bfe
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<i32>;
+fn textureLoad_c2a480() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c2a480();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c2a480();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c2a480();
+}
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl
new file mode 100644
index 0000000..5e1b742
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_c2a480() {
+ int4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+
+tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl
new file mode 100644
index 0000000..d7f7741
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c2a480() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c2a480();
+ return;
+}
+
+
+tint_PlRj7V.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c6fed7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c2a480 "textureLoad_c2a480"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_c2a480 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4int %15 %17 Lod %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_c2a480
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_c2a480
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_c2a480
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl
new file mode 100644
index 0000000..41189cf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<i32>;
+
+fn textureLoad_c2a480() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c2a480();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c2a480();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c2a480();
+}
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl
new file mode 100644
index 0000000..b602b0b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<u32>;
+fn textureLoad_c378ee() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c378ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c378ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c378ee();
+}
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl
new file mode 100644
index 0000000..de64c52
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl
@@ -0,0 +1,51 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_c378ee() {
+ uint4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+
+tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion]
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion]
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion]
+ uint4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl
new file mode 100644
index 0000000..c728035
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c378ee() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c378ee();
+ return;
+}
+
+
+tint_8pq22X.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm
new file mode 100644
index 0000000..5a547d0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c378ee "textureLoad_c378ee"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_c378ee = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4uint %15 %18 Sample %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_c378ee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_c378ee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_c378ee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl
new file mode 100644
index 0000000..f118f6e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureLoad_c378ee() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c378ee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c378ee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c378ee();
+}
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl
new file mode 100644
index 0000000..ba0ed97
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, read>;
+fn textureLoad_c40dcb() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c40dcb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c40dcb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c40dcb();
+}
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl
new file mode 100644
index 0000000..42c8b6a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_c40dcb() {
+ uint4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+
+tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl
new file mode 100644
index 0000000..b100805
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c40dcb() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c40dcb();
+ return;
+}
+
+
+tint_AHh86e.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm
new file mode 100644
index 0000000..843dad9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c40dcb "textureLoad_c40dcb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_c40dcb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %19
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_c40dcb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_c40dcb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_c40dcb
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl
new file mode 100644
index 0000000..e215fc8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureLoad_c40dcb() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c40dcb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c40dcb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c40dcb();
+}
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl
new file mode 100644
index 0000000..484739d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32float, read>;
+fn textureLoad_c456bc() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c456bc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c456bc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c456bc();
+}
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl
new file mode 100644
index 0000000..3a38cae
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_c456bc() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+
+tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl
new file mode 100644
index 0000000..bd9098a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c456bc() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c456bc();
+ return;
+}
+
+
+tint_lhWQnt.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..92d96ed
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c456bc "textureLoad_c456bc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_c456bc = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_c456bc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_c456bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_c456bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c3ace9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<r32float>;
+
+fn textureLoad_c456bc() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c456bc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c456bc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c456bc();
+}
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl
new file mode 100644
index 0000000..983bfe3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32float, read>;
+fn textureLoad_c7cbed() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c7cbed();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c7cbed();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c7cbed();
+}
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl
new file mode 100644
index 0000000..1ad636d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_c7cbed() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl
new file mode 100644
index 0000000..1ad0d4f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c7cbed() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c7cbed();
+ return;
+}
+
+
+tint_Tj6Pxg.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm
new file mode 100644
index 0000000..d63ee64
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c7cbed "textureLoad_c7cbed"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_c7cbed = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_c7cbed
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_c7cbed
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_c7cbed
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl
new file mode 100644
index 0000000..76bbb34
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32float>;
+
+fn textureLoad_c7cbed() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c7cbed();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c7cbed();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c7cbed();
+}
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl
new file mode 100644
index 0000000..0825e3e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8sint, read>;
+fn textureLoad_c9cc40() {
+ var res: vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c9cc40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c9cc40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c9cc40();
+}
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl
new file mode 100644
index 0000000..c46ef6a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_c9cc40() {
+ int4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl
new file mode 100644
index 0000000..75907b0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_c9cc40() {
+ int4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_c9cc40();
+ return;
+}
+
+
+tint_BXWR82.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm
new file mode 100644
index 0000000..7716717
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_c9cc40 "textureLoad_c9cc40"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_c9cc40 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_c9cc40
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_c9cc40
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_c9cc40
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl
new file mode 100644
index 0000000..8cc7670
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8sint>;
+
+fn textureLoad_c9cc40() {
+ var res : vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_c9cc40();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_c9cc40();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_c9cc40();
+}
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl
new file mode 100644
index 0000000..8578b86
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32float, read>;
+fn textureLoad_d5c48d() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d5c48d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d5c48d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d5c48d();
+}
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl
new file mode 100644
index 0000000..4bd5092
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_d5c48d() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+
+tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl
new file mode 100644
index 0000000..3af5b1a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_d5c48d() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_d5c48d();
+ return;
+}
+
+
+tint_caH8d9.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm
new file mode 100644
index 0000000..194a0dc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_d5c48d "textureLoad_d5c48d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_d5c48d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_d5c48d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_d5c48d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_d5c48d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl
new file mode 100644
index 0000000..111f88a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32float>;
+
+fn textureLoad_d5c48d() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d5c48d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d5c48d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d5c48d();
+}
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl
new file mode 100644
index 0000000..c59a55a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32float, read>;
+fn textureLoad_d81c57() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d81c57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d81c57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d81c57();
+}
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl
new file mode 100644
index 0000000..3c88ef9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_d81c57() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_d81c57();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_d81c57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_d81c57();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl
new file mode 100644
index 0000000..3270b75
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_d81c57() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_d81c57();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_d81c57();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_d81c57();
+ return;
+}
+
+
+tint_PBHoWY.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm
new file mode 100644
index 0000000..a0a3217
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_d81c57 "textureLoad_d81c57"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_d81c57 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_d81c57
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_d81c57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_d81c57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef9b797
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rg32float>;
+
+fn textureLoad_d81c57() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d81c57();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d81c57();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d81c57();
+}
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl
new file mode 100644
index 0000000..7a14592
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, read>;
+fn textureLoad_d8617f() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d8617f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d8617f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d8617f();
+}
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl
new file mode 100644
index 0000000..32ca152
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_d8617f() {
+ int4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+
+tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl
new file mode 100644
index 0000000..83ef6be
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_d8617f() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_d8617f();
+ return;
+}
+
+
+tint_kOdpG9.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm
new file mode 100644
index 0000000..bc71530
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_d8617f "textureLoad_d8617f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_d8617f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_d8617f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_d8617f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_d8617f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl
new file mode 100644
index 0000000..7a9f7a3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32sint>;
+
+fn textureLoad_d8617f() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_d8617f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_d8617f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_d8617f();
+}
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl
new file mode 100644
index 0000000..d14f010
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32sint, read>;
+fn textureLoad_dbd554() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_dbd554();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_dbd554();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_dbd554();
+}
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl
new file mode 100644
index 0000000..cad23b2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_dbd554() {
+ int4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+
+tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl
new file mode 100644
index 0000000..4db5a4a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_dbd554() {
+ int4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_dbd554();
+ return;
+}
+
+
+tint_u9YBmc.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm
new file mode 100644
index 0000000..384a41e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_dbd554 "textureLoad_dbd554"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_dbd554 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_dbd554
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_dbd554
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_dbd554
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl
new file mode 100644
index 0000000..2e967b4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba32sint>;
+
+fn textureLoad_dbd554() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_dbd554();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_dbd554();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_dbd554();
+}
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl
new file mode 100644
index 0000000..282486b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32sint, read>;
+fn textureLoad_ddeed3() {
+ var res: vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ddeed3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ddeed3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ddeed3();
+}
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl
new file mode 100644
index 0000000..dc13a6a
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_ddeed3() {
+ int4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl
new file mode 100644
index 0000000..6a9a8d2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_ddeed3() {
+ int4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_ddeed3();
+ return;
+}
+
+
+tint_WoGoyA.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm
new file mode 100644
index 0000000..f64fd4b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_ddeed3 "textureLoad_ddeed3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_ddeed3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_ddeed3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_ddeed3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_ddeed3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl
new file mode 100644
index 0000000..90301b7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba32sint>;
+
+fn textureLoad_ddeed3() {
+ var res : vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ddeed3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ddeed3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ddeed3();
+}
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl
new file mode 100644
index 0000000..28cb9dc
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8sint, read>;
+fn textureLoad_dee8e7() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_dee8e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_dee8e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_dee8e7();
+}
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..37754ac
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_dee8e7() {
+ int4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+
+tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl
new file mode 100644
index 0000000..247ee78
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_dee8e7() {
+ int4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_dee8e7();
+ return;
+}
+
+
+tint_dUo0qj.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..35d8476
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_dee8e7 "textureLoad_dee8e7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_dee8e7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_dee8e7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_dee8e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_dee8e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..9d7c3f9
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba8sint>;
+
+fn textureLoad_dee8e7() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_dee8e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_dee8e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_dee8e7();
+}
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl
new file mode 100644
index 0000000..5323c08
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<i32>;
+fn textureLoad_e3d2cc() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e3d2cc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e3d2cc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e3d2cc();
+}
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl
new file mode 100644
index 0000000..760683e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl
@@ -0,0 +1,51 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureLoad_e3d2cc() {
+ int4 res = arg_0.Load(int3(0), 1);
+}
+
+void vertex_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+
+tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion]
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion]
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
+
+tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion]
+ int4 res = arg_0.Load(int3(0), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl
new file mode 100644
index 0000000..dbe28f3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e3d2cc() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_e3d2cc();
+ return;
+}
+
+
+tint_lPhrIU.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm
new file mode 100644
index 0000000..c3ba65e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_e3d2cc "textureLoad_e3d2cc"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_e3d2cc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageFetch %v4int %15 %17 Sample %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_e3d2cc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_e3d2cc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_e3d2cc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl
new file mode 100644
index 0000000..eccdf9b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureLoad_e3d2cc() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e3d2cc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e3d2cc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e3d2cc();
+}
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl
new file mode 100644
index 0000000..c5cd6f4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32sint, read>;
+fn textureLoad_e65916() {
+ var res: vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e65916();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e65916();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e65916();
+}
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl
new file mode 100644
index 0000000..c6aaac4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_e65916() {
+ int4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_e65916();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_e65916();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e65916();
+ return;
+}
+
+
+tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1)
+ int4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl
new file mode 100644
index 0000000..2bf7b4e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e65916() {
+ int4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_e65916();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_e65916();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_e65916();
+ return;
+}
+
+
+tint_JtCsT6.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm
new file mode 100644
index 0000000..c46e235
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_e65916 "textureLoad_e65916"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_e65916 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_e65916
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_e65916
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_e65916
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl
new file mode 100644
index 0000000..f3f6648
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32sint>;
+
+fn textureLoad_e65916() {
+ var res : vec4<i32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e65916();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e65916();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e65916();
+}
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl
new file mode 100644
index 0000000..7774ade
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16float, read>;
+fn textureLoad_e893d7() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e893d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e893d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e893d7();
+}
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl
new file mode 100644
index 0000000..a030b91
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_e893d7() {
+ float4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+
+tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl
new file mode 100644
index 0000000..39460ff
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e893d7() {
+ float4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_e893d7();
+ return;
+}
+
+
+tint_hiyLRu.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm
new file mode 100644
index 0000000..3268cd2
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_e893d7 "textureLoad_e893d7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_e893d7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_e893d7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_e893d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_e893d7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl
new file mode 100644
index 0000000..4cb54fa
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16float>;
+
+fn textureLoad_e893d7() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_e893d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_e893d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_e893d7();
+}
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl
new file mode 100644
index 0000000..895a08d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32sint, read>;
+fn textureLoad_eb573b() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_eb573b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_eb573b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_eb573b();
+}
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl
new file mode 100644
index 0000000..0bdfa79
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_eb573b() {
+ int4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+
+tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1)
+ int4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl
new file mode 100644
index 0000000..3c7011f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_eb573b() {
+ int4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_eb573b();
+ return;
+}
+
+
+tint_1uDHrX.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm
new file mode 100644
index 0000000..fbebdb8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_eb573b "textureLoad_eb573b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_eb573b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %20
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %17
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_eb573b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_eb573b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_eb573b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl
new file mode 100644
index 0000000..9b8ee43
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<r32sint>;
+
+fn textureLoad_eb573b() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_eb573b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_eb573b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_eb573b();
+}
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl
new file mode 100644
index 0000000..5ee1d3d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16uint, read>;
+fn textureLoad_ecc823() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ecc823();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ecc823();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ecc823();
+}
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl
new file mode 100644
index 0000000..b801b02
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_ecc823() {
+ uint4 res = arg_0.Load(int3(0));
+}
+
+void vertex_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+
+tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
+
+tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1)
+ uint4 res = arg_0.Load(int3(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl
new file mode 100644
index 0000000..22cf47c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_ecc823() {
+ uint4 res = arg_0.read(int2());
+}
+
+vertex void vertex_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_ecc823();
+ return;
+}
+
+
+tint_uJWcQ6.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm
new file mode 100644
index 0000000..19b1a05
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_ecc823 "textureLoad_ecc823"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %18 = OpConstantNull %v2int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_ecc823 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_ecc823
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_ecc823
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_ecc823
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl
new file mode 100644
index 0000000..9a6a788
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d<rgba16uint>;
+
+fn textureLoad_ecc823() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ecc823();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ecc823();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ecc823();
+}
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl
new file mode 100644
index 0000000..8273c31
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32uint, read>;
+fn textureLoad_ef5405() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ef5405();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ef5405();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ef5405();
+}
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl
new file mode 100644
index 0000000..af010dd
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_ef5405() {
+ uint4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+
+tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl
new file mode 100644
index 0000000..cc99a0b
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_ef5405() {
+ uint4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_ef5405();
+ return;
+}
+
+
+tint_vn4Gjj.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm
new file mode 100644
index 0000000..e14736c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_ef5405 "textureLoad_ef5405"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_ef5405 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_ef5405
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_ef5405
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_ef5405
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a9ed28
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32uint>;
+
+fn textureLoad_ef5405() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_ef5405();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_ef5405();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_ef5405();
+}
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl
new file mode 100644
index 0000000..72c83bb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32sint, read>;
+fn textureLoad_f06b69() {
+ var res: vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f06b69();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f06b69();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f06b69();
+}
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl
new file mode 100644
index 0000000..981779d
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureLoad_f06b69() {
+ int4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_f06b69();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_f06b69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f06b69();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl
new file mode 100644
index 0000000..0546f3e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f06b69() {
+ int4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_f06b69();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_f06b69();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_f06b69();
+ return;
+}
+
+
+tint_hzLYnu.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm
new file mode 100644
index 0000000..7394181
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f06b69 "textureLoad_f06b69"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_f06b69 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %19
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %int_1
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_f06b69
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_f06b69
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_f06b69
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl
new file mode 100644
index 0000000..aa69f05
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<r32sint>;
+
+fn textureLoad_f06b69() {
+ var res : vec4<i32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f06b69();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f06b69();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f06b69();
+}
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl
new file mode 100644
index 0000000..eccd87f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, read>;
+fn textureLoad_f379e2() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f379e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f379e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f379e2();
+}
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl
new file mode 100644
index 0000000..e35c3e5
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f379e2() {
+ float4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+
+tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2)
+ float4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl
new file mode 100644
index 0000000..d99131f
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f379e2() {
+ float4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_f379e2();
+ return;
+}
+
+
+tint_noH5on.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm
new file mode 100644
index 0000000..18bdda1
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f379e2 "textureLoad_f379e2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f379e2 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %18
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_f379e2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_f379e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_f379e2
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl
new file mode 100644
index 0000000..ac8b4b3
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureLoad_f379e2() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f379e2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f379e2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f379e2();
+}
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl
new file mode 100644
index 0000000..17a3654
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16uint, read>;
+fn textureLoad_f56e6f() {
+ var res: vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f56e6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f56e6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f56e6f();
+}
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl
new file mode 100644
index 0000000..654bdf8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_f56e6f() {
+ uint4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+
+tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1)
+ uint4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl
new file mode 100644
index 0000000..56cb753
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f56e6f() {
+ uint4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_f56e6f();
+ return;
+}
+
+
+tint_bZeB2M.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm
new file mode 100644
index 0000000..882c01e
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f56e6f "textureLoad_f56e6f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %18 = OpConstantNull %v3int
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %21 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_f56e6f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_f56e6f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_f56e6f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_f56e6f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl
new file mode 100644
index 0000000..c6ee7db
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16uint>;
+
+fn textureLoad_f56e6f() {
+ var res : vec4<u32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f56e6f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f56e6f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f56e6f();
+}
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl
new file mode 100644
index 0000000..37f1354
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32float, read>;
+fn textureLoad_f74bd8() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f74bd8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f74bd8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f74bd8();
+}
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl
new file mode 100644
index 0000000..6d554da
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_f74bd8() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+
+tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl
new file mode 100644
index 0000000..5de8a78
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f74bd8() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_f74bd8();
+ return;
+}
+
+
+tint_bvWoiL.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm
new file mode 100644
index 0000000..1713cb8
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_f74bd8 "textureLoad_f74bd8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f74bd8 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_f74bd8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_f74bd8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_f74bd8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl
new file mode 100644
index 0000000..91cf301
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rg32float>;
+
+fn textureLoad_f74bd8() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_f74bd8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_f74bd8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_f74bd8();
+}
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl
new file mode 100644
index 0000000..48ae1d7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, read>;
+fn textureLoad_fc6d36() {
+ var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fc6d36();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fc6d36();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fc6d36();
+}
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl
new file mode 100644
index 0000000..d316dbf
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureLoad_fc6d36() {
+ int4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+
+tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2)
+ int4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl
new file mode 100644
index 0000000..c7261b4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_fc6d36() {
+ int4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_fc6d36();
+ return;
+}
+
+
+tint_8IAy2k.metal:5:14: error: use of undeclared identifier 'arg_0'
+ int4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm
new file mode 100644
index 0000000..aa02704
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_fc6d36 "textureLoad_fc6d36"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4int = OpTypeVector %int 4
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %21 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureLoad_fc6d36 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %21
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4int %15 %18
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureLoad_fc6d36
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureLoad_fc6d36
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureLoad_fc6d36
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl
new file mode 100644
index 0000000..c08523c
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureLoad_fc6d36() {
+ var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fc6d36();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fc6d36();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fc6d36();
+}
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl
new file mode 100644
index 0000000..5a977ac
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, read>;
+fn textureLoad_fdebd0() {
+ var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fdebd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fdebd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fdebd0();
+}
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl
new file mode 100644
index 0000000..ac749d4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureLoad_fdebd0() {
+ uint4 res = arg_0.Load(int4(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+
+tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
+
+tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2)
+ uint4 res = arg_0.Load(int4(1, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl
new file mode 100644
index 0000000..29c5503
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_fdebd0() {
+ uint4 res = arg_0.read(int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_fdebd0();
+ return;
+}
+
+
+tint_NgCD5o.metal:5:15: error: use of undeclared identifier 'arg_0'
+ uint4 res = arg_0.read(int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm
new file mode 100644
index 0000000..1d39030
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_fdebd0 "textureLoad_fdebd0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v4uint = OpTypeVector %uint 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1
+%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %22 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureLoad_fdebd0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %22
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageRead %v4uint %15 %19
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %textureLoad_fdebd0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_fdebd0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_fdebd0
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '16[%v3int]'s vector component count.
+ %19 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl
new file mode 100644
index 0000000..8993373
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureLoad_fdebd0() {
+ var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fdebd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fdebd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fdebd0();
+}
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl
new file mode 100644
index 0000000..0f8f960
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8snorm, read>;
+fn textureLoad_fe222a() {
+ var res: vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fe222a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fe222a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fe222a();
+}
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl
new file mode 100644
index 0000000..bb2a0b0
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_fe222a() {
+ float4 res = arg_0.Load(int2(1, 0));
+}
+
+void vertex_main() {
+ textureLoad_fe222a();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_fe222a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_fe222a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl
new file mode 100644
index 0000000..c8c0402
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_fe222a() {
+ float4 res = arg_0.read(1);
+}
+
+vertex void vertex_main() {
+ textureLoad_fe222a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_fe222a();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_fe222a();
+ return;
+}
+
+
+tint_cXPONM.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm
new file mode 100644
index 0000000..7ef1da7
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_fe222a "textureLoad_fe222a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_fe222a = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %19
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %int_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureLoad_fe222a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureLoad_fe222a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureLoad_fe222a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6ac877
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d<rgba8snorm>;
+
+fn textureLoad_fe222a() {
+ var res : vec4<f32> = textureLoad(arg_0, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_fe222a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_fe222a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_fe222a();
+}
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl
new file mode 100644
index 0000000..8f36ccb
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16float, read>;
+fn textureLoad_feab99() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_feab99();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_feab99();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_feab99();
+}
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl
new file mode 100644
index 0000000..f720249
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureLoad_feab99() {
+ float4 res = arg_0.Load(int4(0));
+}
+
+void vertex_main() {
+ textureLoad_feab99();
+ return;
+}
+
+void fragment_main() {
+ textureLoad_feab99();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_feab99();
+ return;
+}
+
+
+tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
+
+tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Load(int4(0));
+ ^
+
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl
new file mode 100644
index 0000000..b456fef
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_feab99() {
+ float4 res = arg_0.read(int3());
+}
+
+vertex void vertex_main() {
+ textureLoad_feab99();
+ return;
+}
+
+fragment void fragment_main() {
+ textureLoad_feab99();
+ return;
+}
+
+kernel void compute_main() {
+ textureLoad_feab99();
+ return;
+}
+
+
+tint_7aCudT.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.read(int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm
new file mode 100644
index 0000000..31c2a72
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureLoad_feab99 "textureLoad_feab99"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_feab99 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %20
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageRead %v4float %14 %17
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureLoad_feab99
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureLoad_feab99
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureLoad_feab99
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0de2b4
--- /dev/null
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d<rgba16float>;
+
+fn textureLoad_feab99() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureLoad_feab99();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureLoad_feab99();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureLoad_feab99();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl
new file mode 100644
index 0000000..fa64259
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+fn textureNumLayers_024820() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_024820();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_024820();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_024820();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl
new file mode 100644
index 0000000..066e3c3
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_024820() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_024820();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_024820();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_024820();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl
new file mode 100644
index 0000000..0b6d8ec
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_024820() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_024820();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_024820();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_024820();
+ return;
+}
+
+
+tint_0jVx27.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm
new file mode 100644
index 0000000..a5b63d2
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_024820 "textureNumLayers_024820"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_024820 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_024820
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_024820
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_024820
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl
new file mode 100644
index 0000000..923f42d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLayers_024820() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_024820();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_024820();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_024820();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl
new file mode 100644
index 0000000..a8e1565
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<u32>;
+fn textureNumLayers_053df7() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_053df7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_053df7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_053df7();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl
new file mode 100644
index 0000000..5d43efd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_053df7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl
new file mode 100644
index 0000000..dccaf59
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_053df7() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_053df7();
+ return;
+}
+
+
+tint_eUidBR.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm
new file mode 100644
index 0000000..405ee4a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_053df7 "textureNumLayers_053df7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_053df7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_0
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureNumLayers_053df7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_053df7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureNumLayers_053df7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ff71e2
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLayers_053df7() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_053df7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_053df7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_053df7();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl
new file mode 100644
index 0000000..c3530b1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, write>;
+fn textureNumLayers_058cc3() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_058cc3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_058cc3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_058cc3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl
new file mode 100644
index 0000000..bea559a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_058cc3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl
new file mode 100644
index 0000000..0c8213e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_058cc3() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_058cc3();
+ return;
+}
+
+
+tint_2AGSfO.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm
new file mode 100644
index 0000000..9871813
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_058cc3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_058cc3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_058cc3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_058cc3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ca4230
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32sint>;
+
+fn textureNumLayers_058cc3() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_058cc3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_058cc3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_058cc3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl
new file mode 100644
index 0000000..7522096
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+fn textureNumLayers_09d05d() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_09d05d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_09d05d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_09d05d();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl
new file mode 100644
index 0000000..8b0879e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_09d05d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl
new file mode 100644
index 0000000..ece1e7d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_09d05d() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_09d05d();
+ return;
+}
+
+
+tint_PQwrWX.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm
new file mode 100644
index 0000000..6bbf3f5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_09d05d "textureNumLayers_09d05d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_09d05d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_09d05d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_09d05d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_09d05d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl
new file mode 100644
index 0000000..16aa0f2
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureNumLayers_09d05d() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_09d05d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_09d05d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_09d05d();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl
new file mode 100644
index 0000000..33f4131
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, write>;
+fn textureNumLayers_13b4ce() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_13b4ce();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_13b4ce();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_13b4ce();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl
new file mode 100644
index 0000000..a363038
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_13b4ce() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl
new file mode 100644
index 0000000..068f395
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_13b4ce() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_13b4ce();
+ return;
+}
+
+
+tint_LccGuI.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm
new file mode 100644
index 0000000..0c5d315
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_13b4ce = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_13b4ce
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_13b4ce
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_13b4ce
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6dfe9f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureNumLayers_13b4ce() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_13b4ce();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_13b4ce();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_13b4ce();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl
new file mode 100644
index 0000000..568367e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, write>;
+fn textureNumLayers_22e53b() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_22e53b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_22e53b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_22e53b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl
new file mode 100644
index 0000000..1d275f4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_22e53b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl
new file mode 100644
index 0000000..c00e965
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_22e53b() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_22e53b();
+ return;
+}
+
+
+tint_HhSnq0.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm
new file mode 100644
index 0000000..162d072
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_22e53b "textureNumLayers_22e53b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_22e53b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_22e53b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_22e53b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_22e53b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl
new file mode 100644
index 0000000..8e51176
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32sint>;
+
+fn textureNumLayers_22e53b() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_22e53b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_22e53b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_22e53b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl
new file mode 100644
index 0000000..d0ac8df
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, read>;
+fn textureNumLayers_2f6bb3() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_2f6bb3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_2f6bb3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_2f6bb3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl
new file mode 100644
index 0000000..b4f5780
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_2f6bb3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl
new file mode 100644
index 0000000..46f833c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_2f6bb3() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_2f6bb3();
+ return;
+}
+
+
+tint_h3OOas.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm
new file mode 100644
index 0000000..deb036d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_2f6bb3 "textureNumLayers_2f6bb3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_2f6bb3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_2f6bb3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_2f6bb3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_2f6bb3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl
new file mode 100644
index 0000000..841cafc
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32uint>;
+
+fn textureNumLayers_2f6bb3() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_2f6bb3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_2f6bb3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_2f6bb3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl
new file mode 100644
index 0000000..1cd07fd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, read>;
+fn textureNumLayers_315298() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_315298();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_315298();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_315298();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl
new file mode 100644
index 0000000..637db42
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_315298() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_315298();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_315298();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_315298();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl
new file mode 100644
index 0000000..7e83a77
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_315298() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_315298();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_315298();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_315298();
+ return;
+}
+
+
+tint_GjCxCH.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ff059a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_315298 "textureNumLayers_315298"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_315298 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_315298
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_315298
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_315298
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl
new file mode 100644
index 0000000..5f0a525
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureNumLayers_315298() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_315298();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_315298();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_315298();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl
new file mode 100644
index 0000000..2dd6eaa
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, read>;
+fn textureNumLayers_3615e3() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_3615e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_3615e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_3615e3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl
new file mode 100644
index 0000000..acb2945
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_3615e3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl
new file mode 100644
index 0000000..6946205
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_3615e3() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_3615e3();
+ return;
+}
+
+
+tint_57kzTT.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm
new file mode 100644
index 0000000..ecc75ef
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_3615e3 "textureNumLayers_3615e3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_3615e3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_3615e3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_3615e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_3615e3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl
new file mode 100644
index 0000000..f248320
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureNumLayers_3615e3() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_3615e3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_3615e3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_3615e3();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl
new file mode 100644
index 0000000..044fa99
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, read>;
+fn textureNumLayers_390fd5() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_390fd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_390fd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_390fd5();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl
new file mode 100644
index 0000000..9ab80c5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_390fd5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl
new file mode 100644
index 0000000..953ec8a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_390fd5() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_390fd5();
+ return;
+}
+
+
+tint_CaQl5W.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd442f8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_390fd5 "textureNumLayers_390fd5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_390fd5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_390fd5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_390fd5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_390fd5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl
new file mode 100644
index 0000000..91b250e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureNumLayers_390fd5() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_390fd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_390fd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_390fd5();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl
new file mode 100644
index 0000000..ab2be8b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, read>;
+fn textureNumLayers_45155d() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_45155d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_45155d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_45155d();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl
new file mode 100644
index 0000000..ba95843
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_45155d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl
new file mode 100644
index 0000000..506e75a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_45155d() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_45155d();
+ return;
+}
+
+
+tint_sM3glL.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm
new file mode 100644
index 0000000..dde6292
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_45155d "textureNumLayers_45155d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_45155d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_45155d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_45155d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_45155d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl
new file mode 100644
index 0000000..107a74c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureNumLayers_45155d() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_45155d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_45155d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_45155d();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl
new file mode 100644
index 0000000..45bf5f8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, read>;
+fn textureNumLayers_4bf67b() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_4bf67b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_4bf67b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_4bf67b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl
new file mode 100644
index 0000000..629aa52
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_4bf67b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl
new file mode 100644
index 0000000..c89408c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_4bf67b() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_4bf67b();
+ return;
+}
+
+
+tint_SwyI4f.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm
new file mode 100644
index 0000000..12bd477
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_4bf67b "textureNumLayers_4bf67b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_4bf67b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_4bf67b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_4bf67b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_4bf67b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl
new file mode 100644
index 0000000..2185d73
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32sint>;
+
+fn textureNumLayers_4bf67b() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_4bf67b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_4bf67b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_4bf67b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl
new file mode 100644
index 0000000..3215988
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, write>;
+fn textureNumLayers_562013() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_562013();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_562013();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_562013();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl
new file mode 100644
index 0000000..273ab51
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_562013() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_562013();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_562013();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_562013();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl
new file mode 100644
index 0000000..a0cbaf4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_562013() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_562013();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_562013();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_562013();
+ return;
+}
+
+
+tint_Dlhv3z.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm
new file mode 100644
index 0000000..2f25a38
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_562013 "textureNumLayers_562013"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_562013 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_562013
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_562013
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_562013
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl
new file mode 100644
index 0000000..5a217b6
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16float>;
+
+fn textureNumLayers_562013() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_562013();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_562013();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_562013();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl
new file mode 100644
index 0000000..f752ba0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, read>;
+fn textureNumLayers_57092f() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_57092f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_57092f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_57092f();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl
new file mode 100644
index 0000000..e50de13
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_57092f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl
new file mode 100644
index 0000000..ca0aac9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_57092f() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_57092f();
+ return;
+}
+
+
+tint_OuseLM.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm
new file mode 100644
index 0000000..fdfa698
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_57092f "textureNumLayers_57092f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_57092f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_57092f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_57092f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_57092f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb7bac5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureNumLayers_57092f() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_57092f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_57092f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_57092f();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl
new file mode 100644
index 0000000..a53d9ee
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+fn textureNumLayers_5d59cd() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_5d59cd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_5d59cd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_5d59cd();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl
new file mode 100644
index 0000000..86b51cb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_5d59cd() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl
new file mode 100644
index 0000000..35249eb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_5d59cd() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_5d59cd();
+ return;
+}
+
+
+tint_ip3QKE.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm
new file mode 100644
index 0000000..3dc3190
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_5d59cd = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_5d59cd
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_5d59cd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_5d59cd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl
new file mode 100644
index 0000000..6d6fd6c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLayers_5d59cd() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_5d59cd();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_5d59cd();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_5d59cd();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl
new file mode 100644
index 0000000..82ac2b3
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, write>;
+fn textureNumLayers_68a65b() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_68a65b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_68a65b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_68a65b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl
new file mode 100644
index 0000000..edfd072
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_68a65b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl
new file mode 100644
index 0000000..94c1ccf
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_68a65b() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_68a65b();
+ return;
+}
+
+
+tint_N63zBK.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm
new file mode 100644
index 0000000..1643448
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_68a65b "textureNumLayers_68a65b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_68a65b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_68a65b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_68a65b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_68a65b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl
new file mode 100644
index 0000000..5b331c2
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32float>;
+
+fn textureNumLayers_68a65b() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_68a65b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_68a65b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_68a65b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl
new file mode 100644
index 0000000..54b0615
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube_array;
+fn textureNumLayers_778bd1() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_778bd1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_778bd1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_778bd1();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl
new file mode 100644
index 0000000..4bbc51c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLayers_778bd1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl
new file mode 100644
index 0000000..904ccd9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_778bd1() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_778bd1();
+ return;
+}
+
+
+tint_jiLWFd.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm
new file mode 100644
index 0000000..8c57768
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_778bd1 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_778bd1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_778bd1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_778bd1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl
new file mode 100644
index 0000000..43e7c18
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+fn textureNumLayers_778bd1() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_778bd1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_778bd1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_778bd1();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl
new file mode 100644
index 0000000..846381a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, write>;
+fn textureNumLayers_7f1937() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_7f1937();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_7f1937();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_7f1937();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl
new file mode 100644
index 0000000..2017e6e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_7f1937() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl
new file mode 100644
index 0000000..243a8d0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_7f1937() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_7f1937();
+ return;
+}
+
+
+tint_KD1toJ.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm
new file mode 100644
index 0000000..d20fcb0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_7f1937 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_7f1937
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_7f1937
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_7f1937
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl
new file mode 100644
index 0000000..ffec0d1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32float>;
+
+fn textureNumLayers_7f1937() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_7f1937();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_7f1937();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_7f1937();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl
new file mode 100644
index 0000000..665ad71
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<i32>;
+fn textureNumLayers_85f980() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_85f980();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_85f980();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_85f980();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl
new file mode 100644
index 0000000..c0aa9c7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_85f980() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl
new file mode 100644
index 0000000..7eea88e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_85f980() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_85f980();
+ return;
+}
+
+
+tint_kFnY8n.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm
new file mode 100644
index 0000000..f9ce61f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_85f980 "textureNumLayers_85f980"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_85f980 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_85f980
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_85f980
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_85f980
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl
new file mode 100644
index 0000000..b076871
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLayers_85f980() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_85f980();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_85f980();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_85f980();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl
new file mode 100644
index 0000000..0e8fbe7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<u32>;
+fn textureNumLayers_87953e() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_87953e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_87953e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_87953e();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl
new file mode 100644
index 0000000..96d638f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_87953e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl
new file mode 100644
index 0000000..090725f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_87953e() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_87953e();
+ return;
+}
+
+
+tint_m8n8xs.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm
new file mode 100644
index 0000000..8671f4a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_87953e "textureNumLayers_87953e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_87953e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySizeLod %v3int %17 %int_0
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %textureNumLayers_87953e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_87953e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureNumLayers_87953e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl
new file mode 100644
index 0000000..cfd9b95
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLayers_87953e() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_87953e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_87953e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_87953e();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl
new file mode 100644
index 0000000..423f9c8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<i32>;
+fn textureNumLayers_893e7c() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_893e7c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_893e7c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_893e7c();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl
new file mode 100644
index 0000000..507cb89
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_893e7c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl
new file mode 100644
index 0000000..c0fa33f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_893e7c() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_893e7c();
+ return;
+}
+
+
+tint_Klqhaj.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm
new file mode 100644
index 0000000..445ed71
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_893e7c "textureNumLayers_893e7c"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_893e7c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_893e7c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_893e7c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_893e7c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb3bf2f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLayers_893e7c() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_893e7c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_893e7c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_893e7c();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl
new file mode 100644
index 0000000..22adab5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, read>;
+fn textureNumLayers_938763() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_938763();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_938763();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_938763();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl
new file mode 100644
index 0000000..47da08a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_938763() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_938763();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_938763();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_938763();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl
new file mode 100644
index 0000000..f38a402
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_938763() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_938763();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_938763();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_938763();
+ return;
+}
+
+
+tint_5XNX1P.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm
new file mode 100644
index 0000000..7fcf149
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_938763 "textureNumLayers_938763"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_938763 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_938763
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_938763
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_938763
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl
new file mode 100644
index 0000000..c7a5abc
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32uint>;
+
+fn textureNumLayers_938763() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_938763();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_938763();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_938763();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl
new file mode 100644
index 0000000..26d33d5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, write>;
+fn textureNumLayers_9700fb() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_9700fb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_9700fb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_9700fb();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl
new file mode 100644
index 0000000..d08ca80
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_9700fb() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl
new file mode 100644
index 0000000..b72ddf4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_9700fb() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_9700fb();
+ return;
+}
+
+
+tint_AtgPjG.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm
new file mode 100644
index 0000000..76f48e3
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_9700fb "textureNumLayers_9700fb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_9700fb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_9700fb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_9700fb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_9700fb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl
new file mode 100644
index 0000000..b63c56d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureNumLayers_9700fb() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_9700fb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_9700fb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_9700fb();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl
new file mode 100644
index 0000000..c3967a4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, write>;
+fn textureNumLayers_a216d2() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_a216d2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_a216d2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_a216d2();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl
new file mode 100644
index 0000000..749335c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_a216d2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl
new file mode 100644
index 0000000..5439ad7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_a216d2() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_a216d2();
+ return;
+}
+
+
+tint_KEuSt7.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm
new file mode 100644
index 0000000..092addb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_a216d2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_a216d2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_a216d2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_a216d2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f18aa0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureNumLayers_a216d2() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_a216d2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_a216d2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_a216d2();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl
new file mode 100644
index 0000000..5fd1c96
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, read>;
+fn textureNumLayers_aa08a7() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_aa08a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_aa08a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_aa08a7();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl
new file mode 100644
index 0000000..4c10784
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_aa08a7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl
new file mode 100644
index 0000000..3f76dec
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_aa08a7() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_aa08a7();
+ return;
+}
+
+
+tint_cmcbXy.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm
new file mode 100644
index 0000000..499db63
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_aa08a7 "textureNumLayers_aa08a7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_aa08a7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_aa08a7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_aa08a7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_aa08a7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl
new file mode 100644
index 0000000..82ed03c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32float>;
+
+fn textureNumLayers_aa08a7() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_aa08a7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_aa08a7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_aa08a7();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl
new file mode 100644
index 0000000..b089716
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, read>;
+fn textureNumLayers_ab0c9b() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ab0c9b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ab0c9b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ab0c9b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl
new file mode 100644
index 0000000..c5887d5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_ab0c9b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl
new file mode 100644
index 0000000..21af60a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_ab0c9b() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_ab0c9b();
+ return;
+}
+
+
+tint_3mx4mu.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm
new file mode 100644
index 0000000..5e486fd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_ab0c9b "textureNumLayers_ab0c9b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_ab0c9b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_ab0c9b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_ab0c9b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_ab0c9b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl
new file mode 100644
index 0000000..1d19a42
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rg32sint>;
+
+fn textureNumLayers_ab0c9b() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ab0c9b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ab0c9b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ab0c9b();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl
new file mode 100644
index 0000000..ea80719
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, read>;
+fn textureNumLayers_b8cd76() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_b8cd76();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_b8cd76();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_b8cd76();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl
new file mode 100644
index 0000000..0e8a101
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_b8cd76() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl
new file mode 100644
index 0000000..8855b94
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_b8cd76() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_b8cd76();
+ return;
+}
+
+
+tint_KU2V1S.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm
new file mode 100644
index 0000000..109c12e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_b8cd76 "textureNumLayers_b8cd76"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_b8cd76 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_b8cd76
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_b8cd76
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_b8cd76
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl
new file mode 100644
index 0000000..c769c1e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32float>;
+
+fn textureNumLayers_b8cd76() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_b8cd76();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_b8cd76();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_b8cd76();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl
new file mode 100644
index 0000000..0bed34b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, read>;
+fn textureNumLayers_be1d70() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_be1d70();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_be1d70();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_be1d70();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl
new file mode 100644
index 0000000..a29e8bc
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_be1d70() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl
new file mode 100644
index 0000000..7e0c20c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_be1d70() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_be1d70();
+ return;
+}
+
+
+tint_0Ia5Gx.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm
new file mode 100644
index 0000000..cbe7eff
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_be1d70 "textureNumLayers_be1d70"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_be1d70 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_be1d70
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_be1d70
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_be1d70
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl
new file mode 100644
index 0000000..3474b24
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16float>;
+
+fn textureNumLayers_be1d70() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_be1d70();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_be1d70();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_be1d70();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl
new file mode 100644
index 0000000..b10c464
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, read>;
+fn textureNumLayers_be3acb() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_be3acb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_be3acb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_be3acb();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl
new file mode 100644
index 0000000..fe927b3
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_be3acb() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl
new file mode 100644
index 0000000..a6b1697
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_be3acb() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_be3acb();
+ return;
+}
+
+
+tint_KFyqRK.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm
new file mode 100644
index 0000000..9f51dbd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_be3acb "textureNumLayers_be3acb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_be3acb = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_be3acb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_be3acb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_be3acb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl
new file mode 100644
index 0000000..1d18e59
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<r32float>;
+
+fn textureNumLayers_be3acb() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_be3acb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_be3acb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_be3acb();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl
new file mode 100644
index 0000000..45daa99
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, read>;
+fn textureNumLayers_c09917() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_c09917();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_c09917();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_c09917();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl
new file mode 100644
index 0000000..5753eb4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c09917() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl
new file mode 100644
index 0000000..49a3029
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_c09917() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_c09917();
+ return;
+}
+
+
+tint_TtrZWH.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm
new file mode 100644
index 0000000..98505af
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_c09917 "textureNumLayers_c09917"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_c09917 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_c09917
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_c09917
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_c09917
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl
new file mode 100644
index 0000000..bb20c2f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureNumLayers_c09917() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_c09917();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_c09917();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_c09917();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl
new file mode 100644
index 0000000..248fbc9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, read>;
+fn textureNumLayers_c7c7f2() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_c7c7f2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_c7c7f2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_c7c7f2();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl
new file mode 100644
index 0000000..4b59760
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c7c7f2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl
new file mode 100644
index 0000000..775889c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_c7c7f2() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_c7c7f2();
+ return;
+}
+
+
+tint_92LuOw.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm
new file mode 100644
index 0000000..ed6686c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_c7c7f2 "textureNumLayers_c7c7f2"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_c7c7f2 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_c7c7f2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_c7c7f2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_c7c7f2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl
new file mode 100644
index 0000000..f4de08f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureNumLayers_c7c7f2() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_c7c7f2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_c7c7f2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_c7c7f2();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl
new file mode 100644
index 0000000..146b08d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, write>;
+fn textureNumLayers_cd5dc8() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_cd5dc8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_cd5dc8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_cd5dc8();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl
new file mode 100644
index 0000000..4107f8c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_cd5dc8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl
new file mode 100644
index 0000000..be37d58
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_cd5dc8() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_cd5dc8();
+ return;
+}
+
+
+tint_7rjv9D.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm
new file mode 100644
index 0000000..29ca74b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_cd5dc8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_cd5dc8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_cd5dc8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_cd5dc8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl
new file mode 100644
index 0000000..bddc9ba
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureNumLayers_cd5dc8() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_cd5dc8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_cd5dc8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_cd5dc8();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl
new file mode 100644
index 0000000..191034b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, write>;
+fn textureNumLayers_d5b228() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_d5b228();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_d5b228();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_d5b228();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl
new file mode 100644
index 0000000..2dad2ce
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_d5b228() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl
new file mode 100644
index 0000000..fda4dfe
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_d5b228() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_d5b228();
+ return;
+}
+
+
+tint_yPz3Jj.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm
new file mode 100644
index 0000000..dd55d2b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_d5b228 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_d5b228
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_d5b228
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_d5b228
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl
new file mode 100644
index 0000000..e5f7a259
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32float>;
+
+fn textureNumLayers_d5b228() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_d5b228();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_d5b228();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_d5b228();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl
new file mode 100644
index 0000000..92e4477
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, read>;
+fn textureNumLayers_e15642() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e15642();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e15642();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e15642();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl
new file mode 100644
index 0000000..6615530
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_e15642() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl
new file mode 100644
index 0000000..dcf2190
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_e15642() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_e15642();
+ return;
+}
+
+
+tint_0CbU62.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm
new file mode 100644
index 0000000..15c5d3b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_e15642 "textureNumLayers_e15642"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_e15642 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_e15642
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_e15642
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_e15642
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl
new file mode 100644
index 0000000..4c1ec30
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureNumLayers_e15642() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e15642();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e15642();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e15642();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl
new file mode 100644
index 0000000..5564e7a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+fn textureNumLayers_e31be1() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e31be1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e31be1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e31be1();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl
new file mode 100644
index 0000000..68850da
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_e31be1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl
new file mode 100644
index 0000000..815c6e0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_e31be1() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_e31be1();
+ return;
+}
+
+
+tint_VHnpXj.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm
new file mode 100644
index 0000000..905e2ae
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_e31be1 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_e31be1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_e31be1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_e31be1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl
new file mode 100644
index 0000000..910a278
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureNumLayers_e31be1() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e31be1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e31be1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e31be1();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl
new file mode 100644
index 0000000..831f136
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d_array;
+fn textureNumLayers_e653c0() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e653c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e653c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e653c0();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl
new file mode 100644
index 0000000..5d59267
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLayers_e653c0() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl
new file mode 100644
index 0000000..69f7d45
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_e653c0() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_e653c0();
+ return;
+}
+
+
+tint_ruSiH5.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..a8ae9ae
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_e653c0 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySizeLod %v3int %16 %int_0
+ %12 = OpCompositeExtract %int %14 2
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_e653c0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_e653c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_e653c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..f133adb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+fn textureNumLayers_e653c0() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_e653c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_e653c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_e653c0();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl
new file mode 100644
index 0000000..60e2445
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, write>;
+fn textureNumLayers_ee942f() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ee942f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ee942f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ee942f();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl
new file mode 100644
index 0000000..33663d4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_ee942f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl
new file mode 100644
index 0000000..233095c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_ee942f() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_ee942f();
+ return;
+}
+
+
+tint_RSJrMi.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm
new file mode 100644
index 0000000..773fc74
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_ee942f "textureNumLayers_ee942f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_ee942f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_ee942f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_ee942f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_ee942f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl
new file mode 100644
index 0000000..7874222
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32uint>;
+
+fn textureNumLayers_ee942f() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ee942f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ee942f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ee942f();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl
new file mode 100644
index 0000000..96fc3e3
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, write>;
+fn textureNumLayers_f33005() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_f33005();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_f33005();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_f33005();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl
new file mode 100644
index 0000000..28dbfcb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_f33005() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl
new file mode 100644
index 0000000..48bdc8d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_f33005() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_f33005();
+ return;
+}
+
+
+tint_cU7qBN.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm
new file mode 100644
index 0000000..7237b6c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_f33005 "textureNumLayers_f33005"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %19 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_f33005 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %16 = OpLoad %7 %arg_0
+ %14 = OpImageQuerySize %v3int %16
+ %13 = OpCompositeExtract %int %14 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureNumLayers_f33005
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLayers_f33005
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_f33005
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl
new file mode 100644
index 0000000..8211300
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureNumLayers_f33005() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_f33005();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_f33005();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_f33005();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl
new file mode 100644
index 0000000..47277d1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, write>;
+fn textureNumLayers_fcec98() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_fcec98();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_fcec98();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_fcec98();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl
new file mode 100644
index 0000000..921abf0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_fcec98() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl
new file mode 100644
index 0000000..de3f0e7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_fcec98() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_fcec98();
+ return;
+}
+
+
+tint_7cRIpj.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm
new file mode 100644
index 0000000..8c8256e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_fcec98 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_fcec98
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_fcec98
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_fcec98
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl
new file mode 100644
index 0000000..f3cdcf8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32uint>;
+
+fn textureNumLayers_fcec98() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_fcec98();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_fcec98();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_fcec98();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl
new file mode 100644
index 0000000..077109c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, write>;
+fn textureNumLayers_ff5e89() {
+ var res: i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ff5e89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ff5e89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ff5e89();
+}
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl
new file mode 100644
index 0000000..52e8e30
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_ff5e89() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
+void fragment_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl
new file mode 100644
index 0000000..339f408
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_ff5e89() {
+ int res = int(arg_0.get_array_size());
+}
+
+vertex void vertex_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLayers_ff5e89();
+ return;
+}
+
+
+tint_0FvQko.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_array_size());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm
new file mode 100644
index 0000000..43e4afa
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLayers_ff5e89 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %20
+ %17 = OpLoad %7 %arg_0
+ %15 = OpImageQuerySize %v3int %17
+ %13 = OpCompositeExtract %int %15 2
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureNumLayers_ff5e89
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_ff5e89
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureNumLayers_ff5e89
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl
new file mode 100644
index 0000000..dc726f5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureNumLayers_ff5e89() {
+ var res : i32 = textureNumLayers(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLayers_ff5e89();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLayers_ff5e89();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLayers_ff5e89();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl
new file mode 100644
index 0000000..2782726
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+fn textureNumLevels_076cb5() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_076cb5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_076cb5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_076cb5();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl
new file mode 100644
index 0000000..0356601
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureNumLevels_076cb5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl
new file mode 100644
index 0000000..3277572
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_076cb5() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_076cb5();
+ return;
+}
+
+
+tint_aMtcrd.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm
new file mode 100644
index 0000000..c4b65d1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_076cb5 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_076cb5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_076cb5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_076cb5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl
new file mode 100644
index 0000000..42cfdbf
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+fn textureNumLevels_076cb5() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_076cb5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_076cb5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_076cb5();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl
new file mode 100644
index 0000000..5f13a72
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<i32>;
+fn textureNumLevels_080d95() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_080d95();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_080d95();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_080d95();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl
new file mode 100644
index 0000000..bced17a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_080d95() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl
new file mode 100644
index 0000000..ac22481
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_080d95() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_080d95();
+ return;
+}
+
+
+tint_zRq2iR.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm
new file mode 100644
index 0000000..76c0cb7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_080d95 "textureNumLevels_080d95"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_080d95 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_080d95
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_080d95
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_080d95
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl
new file mode 100644
index 0000000..b358276
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<i32>;
+
+fn textureNumLevels_080d95() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_080d95();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_080d95();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_080d95();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl
new file mode 100644
index 0000000..9f5c5dd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<u32>;
+fn textureNumLevels_09ddd0() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_09ddd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_09ddd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_09ddd0();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl
new file mode 100644
index 0000000..ce4bd02
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_09ddd0() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl
new file mode 100644
index 0000000..5411434
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_09ddd0() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_09ddd0();
+ return;
+}
+
+
+tint_VbPpyN.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm
new file mode 100644
index 0000000..83b255f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_09ddd0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumLevels_09ddd0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_09ddd0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLevels_09ddd0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl
new file mode 100644
index 0000000..12ca9ff
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<u32>;
+
+fn textureNumLevels_09ddd0() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_09ddd0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_09ddd0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_09ddd0();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl
new file mode 100644
index 0000000..e03ec03
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+fn textureNumLevels_105988() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_105988();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_105988();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_105988();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl
new file mode 100644
index 0000000..5e09644
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_105988() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_105988();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_105988();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_105988();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl
new file mode 100644
index 0000000..d42d667
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_105988() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_105988();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_105988();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_105988();
+ return;
+}
+
+
+tint_Orn2HY.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm
new file mode 100644
index 0000000..3bf9719
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_105988 "textureNumLevels_105988"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_105988 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_105988
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_105988
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_105988
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl
new file mode 100644
index 0000000..60b58b2
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLevels_105988() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_105988();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_105988();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_105988();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl
new file mode 100644
index 0000000..41cc9eb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<i32>;
+fn textureNumLevels_23f750() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_23f750();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_23f750();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_23f750();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl
new file mode 100644
index 0000000..54c42b1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_23f750() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl
new file mode 100644
index 0000000..de7be4f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_23f750() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_23f750();
+ return;
+}
+
+
+tint_ne3mQQ.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm
new file mode 100644
index 0000000..0d83d80
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_23f750 "textureNumLevels_23f750"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_23f750 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_23f750
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_23f750
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_23f750
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl
new file mode 100644
index 0000000..26ea98a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<i32>;
+
+fn textureNumLevels_23f750() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_23f750();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_23f750();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_23f750();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl
new file mode 100644
index 0000000..ff12574
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube_array;
+fn textureNumLevels_2c3575() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_2c3575();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_2c3575();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_2c3575();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl
new file mode 100644
index 0000000..0bd3455
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLevels_2c3575() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl
new file mode 100644
index 0000000..1111431
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2c3575() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_2c3575();
+ return;
+}
+
+
+tint_m6GLDO.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm
new file mode 100644
index 0000000..671ebe5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2c3575 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_2c3575
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_2c3575
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_2c3575
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl
new file mode 100644
index 0000000..2cd56a5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+fn textureNumLevels_2c3575() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_2c3575();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_2c3575();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_2c3575();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl
new file mode 100644
index 0000000..3aaae38
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<u32>;
+fn textureNumLevels_5101cf() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_5101cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_5101cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_5101cf();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl
new file mode 100644
index 0000000..4e35f0d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_5101cf() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl
new file mode 100644
index 0000000..a457256
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_5101cf() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_5101cf();
+ return;
+}
+
+
+tint_m3uHe8.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ec9308
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_5101cf "textureNumLevels_5101cf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_5101cf = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumLevels_5101cf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_5101cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLevels_5101cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcb851a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLevels_5101cf() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_5101cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_5101cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_5101cf();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl
new file mode 100644
index 0000000..c56b159
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+fn textureNumLevels_897aaf() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_897aaf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_897aaf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_897aaf();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl
new file mode 100644
index 0000000..4b312a9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_897aaf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl
new file mode 100644
index 0000000..e6aea7e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_897aaf() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_897aaf();
+ return;
+}
+
+
+tint_qjfSAf.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8da41f
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_897aaf "textureNumLevels_897aaf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_897aaf = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_897aaf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_897aaf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_897aaf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl
new file mode 100644
index 0000000..e3ebba5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+fn textureNumLevels_897aaf() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_897aaf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_897aaf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_897aaf();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl
new file mode 100644
index 0000000..d6a4013
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<i32>;
+fn textureNumLevels_9da7a5() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_9da7a5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_9da7a5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_9da7a5();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl
new file mode 100644
index 0000000..9572320
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_9da7a5() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl
new file mode 100644
index 0000000..401531a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_9da7a5() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_9da7a5();
+ return;
+}
+
+
+tint_wbp3EV.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm
new file mode 100644
index 0000000..cf77846
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_9da7a5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_9da7a5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_9da7a5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_9da7a5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl
new file mode 100644
index 0000000..77ca44a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<i32>;
+
+fn textureNumLevels_9da7a5() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_9da7a5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_9da7a5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_9da7a5();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl
new file mode 100644
index 0000000..0647fbc
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<i32>;
+fn textureNumLevels_a91c03() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_a91c03();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_a91c03();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_a91c03();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl
new file mode 100644
index 0000000..150bdad
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_a91c03() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl
new file mode 100644
index 0000000..8bc44fe
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_a91c03() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_a91c03();
+ return;
+}
+
+
+tint_hG4QFz.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad51d5b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_a91c03 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_a91c03
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_a91c03
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_a91c03
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl
new file mode 100644
index 0000000..3df9c9a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLevels_a91c03() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_a91c03();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_a91c03();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_a91c03();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl
new file mode 100644
index 0000000..f7692cf
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+fn textureNumLevels_aee7c8() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_aee7c8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_aee7c8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_aee7c8();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl
new file mode 100644
index 0000000..72487b6
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_aee7c8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl
new file mode 100644
index 0000000..c6d9be9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_aee7c8() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_aee7c8();
+ return;
+}
+
+
+tint_uSNIsH.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm
new file mode 100644
index 0000000..69d6d18
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_aee7c8 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_aee7c8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_aee7c8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_aee7c8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl
new file mode 100644
index 0000000..c962a08
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLevels_aee7c8() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_aee7c8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_aee7c8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_aee7c8();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl
new file mode 100644
index 0000000..6973944
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+fn textureNumLevels_b1b12b() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_b1b12b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_b1b12b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_b1b12b();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl
new file mode 100644
index 0000000..6ef32a8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureNumLevels_b1b12b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl
new file mode 100644
index 0000000..dc31158
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_b1b12b() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_b1b12b();
+ return;
+}
+
+
+tint_fK8sGe.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm
new file mode 100644
index 0000000..38e8686
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_b1b12b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_b1b12b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_b1b12b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_b1b12b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl
new file mode 100644
index 0000000..049e8fe
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+fn textureNumLevels_b1b12b() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_b1b12b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_b1b12b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_b1b12b();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl
new file mode 100644
index 0000000..8a828c7
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<u32>;
+fn textureNumLevels_b4f5ea() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_b4f5ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_b4f5ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_b4f5ea();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl
new file mode 100644
index 0000000..508d470
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_b4f5ea() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl
new file mode 100644
index 0000000..e3b7eab
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_b4f5ea() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_b4f5ea();
+ return;
+}
+
+
+tint_kN6LIC.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm
new file mode 100644
index 0000000..7f154b6
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_b4f5ea = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumLevels_b4f5ea
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_b4f5ea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLevels_b4f5ea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl
new file mode 100644
index 0000000..7039b94
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<u32>;
+
+fn textureNumLevels_b4f5ea() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_b4f5ea();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_b4f5ea();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_b4f5ea();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl
new file mode 100644
index 0000000..03e60ce
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<i32>;
+fn textureNumLevels_d004a9() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_d004a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_d004a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_d004a9();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl
new file mode 100644
index 0000000..50f4727
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_d004a9() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl
new file mode 100644
index 0000000..36d75bb
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_d004a9() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_d004a9();
+ return;
+}
+
+
+tint_J6mNNT.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c1f0f8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_d004a9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_d004a9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_d004a9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_d004a9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl
new file mode 100644
index 0000000..7252959
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLevels_d004a9() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_d004a9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_d004a9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_d004a9();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl
new file mode 100644
index 0000000..887a74d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+fn textureNumLevels_dca09e() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_dca09e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_dca09e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_dca09e();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl
new file mode 100644
index 0000000..c99f1f5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_dca09e() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl
new file mode 100644
index 0000000..22eaf18
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_dca09e() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_dca09e();
+ return;
+}
+
+
+tint_xvDrXY.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm
new file mode 100644
index 0000000..1df5c53
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_dca09e "textureNumLevels_dca09e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_dca09e = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_dca09e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_dca09e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_dca09e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d4e4a04
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+fn textureNumLevels_dca09e() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_dca09e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_dca09e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_dca09e();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl
new file mode 100644
index 0000000..f8aca61
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+fn textureNumLevels_e67231() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_e67231();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_e67231();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_e67231();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl
new file mode 100644
index 0000000..9650c58
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_e67231() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl
new file mode 100644
index 0000000..5d21794
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_e67231() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_e67231();
+ return;
+}
+
+
+tint_qOzNfD.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd2fa74
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_e67231 "textureNumLevels_e67231"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_e67231 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_e67231
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_e67231
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_e67231
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl
new file mode 100644
index 0000000..ec3dbc1
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+fn textureNumLevels_e67231() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_e67231();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_e67231();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_e67231();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl
new file mode 100644
index 0000000..c4d7935
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<u32>;
+fn textureNumLevels_ed078b() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_ed078b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_ed078b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_ed078b();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl
new file mode 100644
index 0000000..96fdcf8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_ed078b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl
new file mode 100644
index 0000000..95cc51a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_ed078b() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_ed078b();
+ return;
+}
+
+
+tint_mMDibi.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm
new file mode 100644
index 0000000..54f3ef5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_ed078b "textureNumLevels_ed078b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_ed078b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumLevels_ed078b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_ed078b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLevels_ed078b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl
new file mode 100644
index 0000000..cd4237d
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<u32>;
+
+fn textureNumLevels_ed078b() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_ed078b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_ed078b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_ed078b();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl
new file mode 100644
index 0000000..7f05b5c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<u32>;
+fn textureNumLevels_f46ec6() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_f46ec6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_f46ec6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_f46ec6();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl
new file mode 100644
index 0000000..a40d646
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_f46ec6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl
new file mode 100644
index 0000000..2d67f01
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_f46ec6() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_f46ec6();
+ return;
+}
+
+
+tint_PqHlsD.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm
new file mode 100644
index 0000000..0a842b6
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_f46ec6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQueryLevels %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumLevels_f46ec6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_f46ec6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLevels_f46ec6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa0b57a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLevels_f46ec6() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_f46ec6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_f46ec6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_f46ec6();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl
new file mode 100644
index 0000000..364f974
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d_array;
+fn textureNumLevels_f5828d() {
+ var res: i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_f5828d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_f5828d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_f5828d();
+}
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl
new file mode 100644
index 0000000..370e9e9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLevels_f5828d() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ int res = tint_tmp.w;
+}
+
+void vertex_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
+void fragment_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl
new file mode 100644
index 0000000..49aebc8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_f5828d() {
+ int res = int(arg_0.get_num_mip_levels());
+}
+
+vertex void vertex_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumLevels_f5828d();
+ return;
+}
+
+
+tint_loTxTw.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_mip_levels());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm
new file mode 100644
index 0000000..7691bf9
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_f5828d "textureNumLevels_f5828d"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumLevels_f5828d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQueryLevels %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumLevels_f5828d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumLevels_f5828d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLevels_f5828d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl
new file mode 100644
index 0000000..5602040
--- /dev/null
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+fn textureNumLevels_f5828d() {
+ var res : i32 = textureNumLevels(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumLevels_f5828d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumLevels_f5828d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumLevels_f5828d();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl
new file mode 100644
index 0000000..1f161e5
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<f32>;
+fn textureNumSamples_2c6f14() {
+ var res: i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_2c6f14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_2c6f14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_2c6f14();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl
new file mode 100644
index 0000000..a304fa0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_2c6f14() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
+void fragment_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl
new file mode 100644
index 0000000..fddb2a8
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_2c6f14() {
+ int res = int(arg_0.get_num_samples());
+}
+
+vertex void vertex_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumSamples_2c6f14();
+ return;
+}
+
+
+tint_TdWxzV.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_samples());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm
new file mode 100644
index 0000000..3babdf6
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumSamples_2c6f14 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %12 = OpImageQuerySamples %int %14
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumSamples_2c6f14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumSamples_2c6f14
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumSamples_2c6f14
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl
new file mode 100644
index 0000000..f1f538b
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureNumSamples_2c6f14() {
+ var res : i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_2c6f14();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_2c6f14();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_2c6f14();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl
new file mode 100644
index 0000000..b29f0bd
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<u32>;
+fn textureNumSamples_42f8bb() {
+ var res: i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_42f8bb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_42f8bb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_42f8bb();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl
new file mode 100644
index 0000000..99a0973
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureNumSamples_42f8bb() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
+void fragment_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl
new file mode 100644
index 0000000..616833c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_42f8bb() {
+ int res = int(arg_0.get_num_samples());
+}
+
+vertex void vertex_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumSamples_42f8bb();
+ return;
+}
+
+
+tint_Z8ljof.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_samples());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm
new file mode 100644
index 0000000..646c0b0
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %18 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumSamples_42f8bb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %15 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySamples %int %15
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureNumSamples_42f8bb
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_42f8bb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumSamples_42f8bb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl
new file mode 100644
index 0000000..bf84412
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureNumSamples_42f8bb() {
+ var res : i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_42f8bb();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_42f8bb();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_42f8bb();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl
new file mode 100644
index 0000000..b92b2e4
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_multisampled_2d<i32>;
+fn textureNumSamples_449d23() {
+ var res: i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_449d23();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_449d23();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_449d23();
+}
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl
new file mode 100644
index 0000000..7709661
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl
@@ -0,0 +1,24 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureNumSamples_449d23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ int res = tint_tmp.z;
+}
+
+void vertex_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
+void fragment_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl
new file mode 100644
index 0000000..7f2566c
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_449d23() {
+ int res = int(arg_0.get_num_samples());
+}
+
+vertex void vertex_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
+fragment void fragment_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
+kernel void compute_main() {
+ textureNumSamples_449d23();
+ return;
+}
+
+
+tint_gYoBhK.metal:5:17: error: use of undeclared identifier 'arg_0'
+ int res = int(arg_0.get_num_samples());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm
new file mode 100644
index 0000000..60f158a
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_449d23 "textureNumSamples_449d23"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%_ptr_Function_int = OpTypePointer Function %int
+ %17 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+%textureNumSamples_449d23 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %17
+ %14 = OpLoad %7 %arg_0
+ %13 = OpImageQuerySamples %int %14
+ OpStore %res %13
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureNumSamples_449d23
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureNumSamples_449d23
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumSamples_449d23
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c15b3e
--- /dev/null
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureNumSamples_449d23() {
+ var res : i32 = textureNumSamples(arg_0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureNumSamples_449d23();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureNumSamples_449d23();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureNumSamples_449d23();
+}
diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl
new file mode 100644
index 0000000..435d7f4
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_02aa9b() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_02aa9b();
+}
diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl
new file mode 100644
index 0000000..d326424
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_02aa9b() {
+ float4 res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0));
+}
+
+void fragment_main() {
+ textureSample_02aa9b();
+ return;
+}
+
+
+tint_O72GUO:5:43: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl
new file mode 100644
index 0000000..22a92ab
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_02aa9b() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, int2());
+}
+
+fragment void fragment_main() {
+ textureSample_02aa9b();
+ return;
+}
+
+
+tint_3llOQ2.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, int2());
+ ^
+tint_3llOQ2.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm
new file mode 100644
index 0000000..53aa580
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_02aa9b "textureSample_02aa9b"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2int = OpTypeVector %int 2
+ %24 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %27 = OpConstantNull %v4float
+%textureSample_02aa9b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %27
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %19 = OpConvertSToF %float %int_1
+ %22 = OpCompositeConstruct %v3float %19
+ %12 = OpImageSampleImplicitLod %v4float %17 %22 ConstOffset %24
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureSample_02aa9b
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %22 = OpCompositeConstruct %v3float %19
+
diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl
new file mode 100644
index 0000000..b005caa
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_02aa9b() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_02aa9b();
+}
diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl b/test/intrinsics/gen/textureSample/100dc0.wgsl
new file mode 100644
index 0000000..4ced97c
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/100dc0.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_100dc0() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(), vec3<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_100dc0();
+}
diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl
new file mode 100644
index 0000000..9f8134c
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_100dc0() {
+ float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0));
+}
+
+void fragment_main() {
+ textureSample_100dc0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl
new file mode 100644
index 0000000..8bc14f4
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_100dc0() {
+ float4 res = arg_0.sample(arg_1, float3(), int3());
+}
+
+fragment void fragment_main() {
+ textureSample_100dc0();
+ return;
+}
+
+
+tint_Fkbrex.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), int3());
+ ^
+tint_Fkbrex.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), int3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm
new file mode 100644
index 0000000..4639de2
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_100dc0 "textureSample_100dc0"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %22 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+%textureSample_100dc0 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 ConstOffset %22
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureSample_100dc0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl
new file mode 100644
index 0000000..6fcbb13
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_100dc0() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(), vec3<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_100dc0();
+}
diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl
new file mode 100644
index 0000000..1e7ad3b
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_38bbb9() {
+ var res: f32 = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_38bbb9();
+}
diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl
new file mode 100644
index 0000000..3cedaf2
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_38bbb9() {
+ float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_38bbb9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl
new file mode 100644
index 0000000..38eea19
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_38bbb9() {
+ float res = arg_0.sample(arg_1, float2());
+}
+
+fragment void fragment_main() {
+ textureSample_38bbb9();
+ return;
+}
+
+
+tint_fTMbcr.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2());
+ ^
+tint_fTMbcr.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm
new file mode 100644
index 0000000..965b178
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_38bbb9 "textureSample_38bbb9"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %20 = OpConstantNull %v2float
+%_ptr_Function_float = OpTypePointer Function %float
+ %23 = OpConstantNull %float
+%textureSample_38bbb9 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %23
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %13 = OpImageSampleImplicitLod %v4float %18 %20
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSample_38bbb9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl
new file mode 100644
index 0000000..3d321ed
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_38bbb9() {
+ var res : f32 = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_38bbb9();
+}
diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl
new file mode 100644
index 0000000..fb13a0e
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_3b50bd() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_3b50bd();
+}
diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl
new file mode 100644
index 0000000..b14b6e5
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_3b50bd() {
+ float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_3b50bd();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl
new file mode 100644
index 0000000..1f171fe
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_3b50bd() {
+ float4 res = arg_0.sample(arg_1, float3());
+}
+
+fragment void fragment_main() {
+ textureSample_3b50bd();
+ return;
+}
+
+
+tint_rGB6Up.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3());
+ ^
+tint_rGB6Up.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm
new file mode 100644
index 0000000..c41cc4d
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_3b50bd "textureSample_3b50bd"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %22 = OpConstantNull %v4float
+%textureSample_3b50bd = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %22
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureSample_3b50bd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl
new file mode 100644
index 0000000..268e4e4
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_3b50bd() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_3b50bd();
+}
diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl
new file mode 100644
index 0000000..0e9ecba
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_4dd1bf() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_4dd1bf();
+}
diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl
new file mode 100644
index 0000000..7cee1c7
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_4dd1bf() {
+ float4 res = arg_0.Sample(arg_1, float4(float(1)));
+}
+
+void fragment_main() {
+ textureSample_4dd1bf();
+ return;
+}
+
+
+tint_KfNSDx:5:43: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.Sample(arg_1, float4(float(1)));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl
new file mode 100644
index 0000000..5a3b8c8
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_4dd1bf() {
+ float4 res = arg_0.sample(arg_1, float3(), 1);
+}
+
+fragment void fragment_main() {
+ textureSample_4dd1bf();
+ return;
+}
+
+
+tint_ULElO7.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), 1);
+ ^
+tint_ULElO7.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), 1);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm
new file mode 100644
index 0000000..3e5ee96
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_4dd1bf "textureSample_4dd1bf"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %24 = OpConstantNull %v4float
+%textureSample_4dd1bf = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %24
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %18 = OpConvertSToF %float %int_1
+ %21 = OpCompositeConstruct %v4float %18
+ %12 = OpImageSampleImplicitLod %v4float %17 %21
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureSample_4dd1bf
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %21 = OpCompositeConstruct %v4float %18
+
diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl
new file mode 100644
index 0000000..25c98d3
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_4dd1bf() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_4dd1bf();
+}
diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl b/test/intrinsics/gen/textureSample/51b514.wgsl
new file mode 100644
index 0000000..f99e821
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/51b514.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_51b514() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_51b514();
+}
diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl
new file mode 100644
index 0000000..a82f95f
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_51b514() {
+ float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_51b514();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl
new file mode 100644
index 0000000..aa11503
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_51b514() {
+ float4 res = arg_0.sample(arg_1, float2());
+}
+
+fragment void fragment_main() {
+ textureSample_51b514();
+ return;
+}
+
+
+tint_DjFmC0.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2());
+ ^
+tint_DjFmC0.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm
new file mode 100644
index 0000000..a7f4db5
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_51b514 "textureSample_51b514"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %19 = OpConstantNull %v2float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %22 = OpConstantNull %v4float
+%textureSample_51b514 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %22
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureSample_51b514
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl
new file mode 100644
index 0000000..825becd
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_51b514() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_51b514();
+}
diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl b/test/intrinsics/gen/textureSample/667d76.wgsl
new file mode 100644
index 0000000..941d7b1
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/667d76.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_667d76() {
+ var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(), vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_667d76();
+}
diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl
new file mode 100644
index 0000000..b006a77
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_667d76() {
+ float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0));
+}
+
+void fragment_main() {
+ textureSample_667d76();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl
new file mode 100644
index 0000000..f49d51c
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_667d76() {
+ float res = arg_0.sample(arg_1, float2(), int2());
+}
+
+fragment void fragment_main() {
+ textureSample_667d76();
+ return;
+}
+
+
+tint_Mx8eug.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), int2());
+ ^
+tint_Mx8eug.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm
new file mode 100644
index 0000000..f813d47
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_667d76 "textureSample_667d76"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %20 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %23 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpConstantNull %float
+%textureSample_667d76 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %26
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %13 = OpImageSampleImplicitLod %v4float %18 %20 ConstOffset %23
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSample_667d76
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e92695
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_667d76() {
+ var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(), vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_667d76();
+}
diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl b/test/intrinsics/gen/textureSample/6717ca.wgsl
new file mode 100644
index 0000000..f4b3ab1
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6717ca.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_6717ca() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_6717ca();
+}
diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl
new file mode 100644
index 0000000..7215cbe
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_6717ca() {
+ float4 res = arg_0.Sample(arg_1, float3(float(1)));
+}
+
+void fragment_main() {
+ textureSample_6717ca();
+ return;
+}
+
+
+tint_0ZWvLf:5:43: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.Sample(arg_1, float3(float(1)));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl
new file mode 100644
index 0000000..6467e69
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_6717ca() {
+ float4 res = arg_0.sample(arg_1, float2(), 1);
+}
+
+fragment void fragment_main() {
+ textureSample_6717ca();
+ return;
+}
+
+
+tint_u9HsAP.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1);
+ ^
+tint_u9HsAP.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm
new file mode 100644
index 0000000..0879b64
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_6717ca "textureSample_6717ca"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+%textureSample_6717ca = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %19 = OpConvertSToF %float %int_1
+ %22 = OpCompositeConstruct %v3float %19
+ %12 = OpImageSampleImplicitLod %v4float %17 %22
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureSample_6717ca
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %22 = OpCompositeConstruct %v3float %19
+
diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl
new file mode 100644
index 0000000..9d9e695
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_6717ca() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_6717ca();
+}
diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl
new file mode 100644
index 0000000..8a2dc06
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_1d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_6e64fb() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_6e64fb();
+}
diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl
new file mode 100644
index 0000000..3956953
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_6e64fb() {
+ float4 res = arg_0.Sample(arg_1, 1.0f);
+}
+
+void fragment_main() {
+ textureSample_6e64fb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl
new file mode 100644
index 0000000..c095498
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_6e64fb() {
+ float4 res = arg_0.sample(arg_1, 1.0f);
+}
+
+fragment void fragment_main() {
+ textureSample_6e64fb();
+ return;
+}
+
+
+tint_Gw7uQt.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, 1.0f);
+ ^
+tint_Gw7uQt.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, 1.0f);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm
new file mode 100644
index 0000000..83a8589
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_6e64fb "textureSample_6e64fb"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %21 = OpConstantNull %v4float
+%textureSample_6e64fb = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %21
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureSample_6e64fb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl
new file mode 100644
index 0000000..7e7d7ec
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_1d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_6e64fb() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_6e64fb();
+}
diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl
new file mode 100644
index 0000000..2c79264
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_7c3baa() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_7c3baa();
+}
diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl
new file mode 100644
index 0000000..b3fbf88
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_7c3baa() {
+ float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0));
+}
+
+void fragment_main() {
+ textureSample_7c3baa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl
new file mode 100644
index 0000000..232efb4
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_7c3baa() {
+ float4 res = arg_0.sample(arg_1, float2(), int2());
+}
+
+fragment void fragment_main() {
+ textureSample_7c3baa();
+ return;
+}
+
+
+tint_6J7fSq.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), int2());
+ ^
+tint_6J7fSq.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm
new file mode 100644
index 0000000..fcc0c51
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_7c3baa "textureSample_7c3baa"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %19 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %22 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+%textureSample_7c3baa = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 ConstOffset %22
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureSample_7c3baa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl
new file mode 100644
index 0000000..7491762
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_7c3baa() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(), vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_7c3baa();
+}
diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl
new file mode 100644
index 0000000..524197f
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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 textureSample_7e9ffd() {
+ var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_7e9ffd();
+}
diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl
new file mode 100644
index 0000000..26b25cc
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_7e9ffd() {
+ float res = arg_0.Sample(arg_1, float3(float(1)));
+}
+
+void fragment_main() {
+ textureSample_7e9ffd();
+ return;
+}
+
+
+tint_RyRxHD:5:42: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.Sample(arg_1, float3(float(1)));
+ ^
+tint_RyRxHD:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Sample(arg_1, float3(float(1)));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl
new file mode 100644
index 0000000..d91c03d
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_7e9ffd() {
+ float res = arg_0.sample(arg_1, float2(), 1);
+}
+
+fragment void fragment_main() {
+ textureSample_7e9ffd();
+ return;
+}
+
+
+tint_RtNcbu.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), 1);
+ ^
+tint_RtNcbu.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), 1);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a24929
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_7e9ffd "textureSample_7e9ffd"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpConstantNull %float
+%textureSample_7e9ffd = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %26
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %20 = OpConvertSToF %float %int_1
+ %23 = OpCompositeConstruct %v3float %20
+ %13 = OpImageSampleImplicitLod %v4float %18 %23
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSample_7e9ffd
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %23 = OpCompositeConstruct %v3float %20
+
diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl
new file mode 100644
index 0000000..b570940
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_7e9ffd() {
+ var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_7e9ffd();
+}
diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl b/test/intrinsics/gen/textureSample/8522e7.wgsl
new file mode 100644
index 0000000..63ba7f3
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/8522e7.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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 textureSample_8522e7() {
+ var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_8522e7();
+}
diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..ff31c64
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_8522e7() {
+ float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0));
+}
+
+void fragment_main() {
+ textureSample_8522e7();
+ return;
+}
+
+
+tint_jIHeES:5:42: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0));
+ ^
+tint_jIHeES:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl
new file mode 100644
index 0000000..6b7d61a
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_8522e7() {
+ float res = arg_0.sample(arg_1, float2(), 1, int2());
+}
+
+fragment void fragment_main() {
+ textureSample_8522e7();
+ return;
+}
+
+
+tint_Dm6FKk.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), 1, int2());
+ ^
+tint_Dm6FKk.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), 1, int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..6df06c5
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_8522e7 "textureSample_8522e7"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2int = OpTypeVector %int 2
+ %25 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpConstantNull %float
+%textureSample_8522e7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %28
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %20 = OpConvertSToF %float %int_1
+ %23 = OpCompositeConstruct %v3float %20
+ %13 = OpImageSampleImplicitLod %v4float %18 %23 ConstOffset %25
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureSample_8522e7
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %23 = OpCompositeConstruct %v3float %20
+
diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..4133cde
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_8522e7() {
+ var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_8522e7();
+}
diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl
new file mode 100644
index 0000000..6c66d76
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_external;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_bb81ce() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_bb81ce();
+}
diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl
new file mode 100644
index 0000000..97de448
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_bb81ce() {
+ float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_bb81ce();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl
new file mode 100644
index 0000000..e102e8c
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_bb81ce() {
+ float4 res = arg_0.sample(arg_1, float2());
+}
+
+fragment void fragment_main() {
+ textureSample_bb81ce();
+ return;
+}
+
+
+tint_fZQEeQ.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2());
+ ^
+tint_fZQEeQ.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm
new file mode 100644
index 0000000..8f0cf04
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_bb81ce "textureSample_bb81ce"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %19 = OpConstantNull %v2float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %22 = OpConstantNull %v4float
+%textureSample_bb81ce = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %22
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureSample_bb81ce
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl
new file mode 100644
index 0000000..b82de69
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : external_texture;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_bb81ce() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_bb81ce();
+}
diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl
new file mode 100644
index 0000000..8a96b2a
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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 textureSample_c2f4e8() {
+ var res: f32 = textureSample(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_c2f4e8();
+}
diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl
new file mode 100644
index 0000000..7a08bcd
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_c2f4e8() {
+ float res = arg_0.Sample(arg_1, float4(float(1)));
+}
+
+void fragment_main() {
+ textureSample_c2f4e8();
+ return;
+}
+
+
+tint_YC11Cc:5:42: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float res = arg_0.Sample(arg_1, float4(float(1)));
+ ^
+tint_YC11Cc:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.Sample(arg_1, float4(float(1)));
+ ^
+
diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl
new file mode 100644
index 0000000..5d00e0a
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_c2f4e8() {
+ float res = arg_0.sample(arg_1, float3(), 1);
+}
+
+fragment void fragment_main() {
+ textureSample_c2f4e8();
+ return;
+}
+
+
+tint_yWQ2qq.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float3(), 1);
+ ^
+tint_yWQ2qq.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float3(), 1);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d8ec28
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_c2f4e8 "textureSample_c2f4e8"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %25 = OpConstantNull %float
+%textureSample_c2f4e8 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %25
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %19 = OpConvertSToF %float %int_1
+ %22 = OpCompositeConstruct %v4float %19
+ %13 = OpImageSampleImplicitLod %v4float %18 %22
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureSample_c2f4e8
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %22 = OpCompositeConstruct %v4float %19
+
diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl
new file mode 100644
index 0000000..835f3c2
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_c2f4e8() {
+ var res : f32 = textureSample(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_c2f4e8();
+}
diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl b/test/intrinsics/gen/textureSample/e53267.wgsl
new file mode 100644
index 0000000..203f39d
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/e53267.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_e53267() {
+ var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_e53267();
+}
diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl
new file mode 100644
index 0000000..0c94164
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_e53267() {
+ float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_e53267();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl
new file mode 100644
index 0000000..a27e241
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_e53267() {
+ float4 res = arg_0.sample(arg_1, float3());
+}
+
+fragment void fragment_main() {
+ textureSample_e53267();
+ return;
+}
+
+
+tint_HSAV5Q.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3());
+ ^
+tint_HSAV5Q.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm
new file mode 100644
index 0000000..814f3b6
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm
@@ -0,0 +1,48 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 26
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_e53267 "textureSample_e53267"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %22 = OpConstantNull %v4float
+%textureSample_e53267 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %22
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureSample_e53267
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl
new file mode 100644
index 0000000..64f9da9
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_e53267() {
+ var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_e53267();
+}
diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl b/test/intrinsics/gen/textureSample/ea7030.wgsl
new file mode 100644
index 0000000..a3b09c7
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/ea7030.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSample_ea7030() {
+ var res: f32 = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_ea7030();
+}
diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl
new file mode 100644
index 0000000..e77f8f2
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+TextureCube arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSample_ea7030() {
+ float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f));
+}
+
+void fragment_main() {
+ textureSample_ea7030();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl
new file mode 100644
index 0000000..1a09ff0
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSample_ea7030() {
+ float res = arg_0.sample(arg_1, float3());
+}
+
+fragment void fragment_main() {
+ textureSample_ea7030();
+ return;
+}
+
+
+tint_hX4U1g.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float3());
+ ^
+tint_hX4U1g.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm
new file mode 100644
index 0000000..6109222
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSample_ea7030 "textureSample_ea7030"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %17 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %20 = OpConstantNull %v3float
+%_ptr_Function_float = OpTypePointer Function %float
+ %23 = OpConstantNull %float
+%textureSample_ea7030 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %23
+ %15 = OpLoad %7 %arg_1
+ %16 = OpLoad %3 %arg_0
+ %18 = OpSampledImage %17 %16 %15
+ %13 = OpImageSampleImplicitLod %v4float %18 %20
+ %12 = OpCompositeExtract %float %13 0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSample_ea7030
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl
new file mode 100644
index 0000000..580b0b0
--- /dev/null
+++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSample_ea7030() {
+ var res : f32 = textureSample(arg_0, arg_1, vec3<f32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSample_ea7030();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl
new file mode 100644
index 0000000..d234856
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_53b9f7() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_53b9f7();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl
new file mode 100644
index 0000000..f5efca2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_53b9f7() {
+ float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleBias_53b9f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl
new file mode 100644
index 0000000..3ceac72
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_53b9f7() {
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+}
+
+fragment void fragment_main() {
+ textureSampleBias_53b9f7();
+ return;
+}
+
+
+tint_fXClsP.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+ ^
+tint_fXClsP.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..ff35323
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_53b9f7 "textureSampleBias_53b9f7"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %23 = OpConstantNull %v4float
+%textureSampleBias_53b9f7 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %23
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSampleBias_53b9f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..aaeec48
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_53b9f7() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_53b9f7();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl
new file mode 100644
index 0000000..182ec27
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_65ac50() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_65ac50();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl
new file mode 100644
index 0000000..1683e75
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_65ac50() {
+ float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+}
+
+void fragment_main() {
+ textureSampleBias_65ac50();
+ return;
+}
+
+
+tint_faUSzc:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl
new file mode 100644
index 0000000..aa25372
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_65ac50() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2());
+}
+
+fragment void fragment_main() {
+ textureSampleBias_65ac50();
+ return;
+}
+
+
+tint_VENNtZ.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2());
+ ^
+tint_VENNtZ.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm
new file mode 100644
index 0000000..60b9040
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_65ac50 "textureSampleBias_65ac50"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %v2int = OpTypeVector %int 2
+ %25 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpConstantNull %v4float
+%textureSampleBias_65ac50 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %28
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %19 = OpConvertSToF %float %int_1
+ %22 = OpCompositeConstruct %v3float %19
+ %12 = OpImageSampleImplicitLod %v4float %17 %22 Bias|ConstOffset %float_1 %25
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureSampleBias_65ac50
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %22 = OpCompositeConstruct %v3float %19
+
diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl
new file mode 100644
index 0000000..915c1f4
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_65ac50() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_65ac50();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl
new file mode 100644
index 0000000..53fe0bd
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_6a9113() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_6a9113();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl
new file mode 100644
index 0000000..62d816a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_6a9113() {
+ float4 res = arg_0.SampleBias(arg_1, float2(0.0f, 0.0f), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleBias_6a9113();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl
new file mode 100644
index 0000000..e696093
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_6a9113() {
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
+}
+
+fragment void fragment_main() {
+ textureSampleBias_6a9113();
+ return;
+}
+
+
+tint_n6HLQB.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
+ ^
+tint_n6HLQB.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb73824
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_6a9113 "textureSampleBias_6a9113"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %19 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %23 = OpConstantNull %v4float
+%textureSampleBias_6a9113 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %23
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSampleBias_6a9113
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl
new file mode 100644
index 0000000..36043aa
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_6a9113() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_6a9113();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl
new file mode 100644
index 0000000..599748f
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_80e579() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_80e579();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl
new file mode 100644
index 0000000..a0331fd
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_80e579() {
+ float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleBias_80e579();
+ return;
+}
+
+
+tint_QgQYLu:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl
new file mode 100644
index 0000000..e185887
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_80e579() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f));
+}
+
+fragment void fragment_main() {
+ textureSampleBias_80e579();
+ return;
+}
+
+
+tint_VVVRdp.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f));
+ ^
+tint_VVVRdp.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ee8e56
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_80e579 "textureSampleBias_80e579"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleBias_80e579 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %19 = OpConvertSToF %float %int_1
+ %22 = OpCompositeConstruct %v3float %19
+ %12 = OpImageSampleImplicitLod %v4float %17 %22 Bias %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleBias_80e579
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %22 = OpCompositeConstruct %v3float %19
+
diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl
new file mode 100644
index 0000000..6134ecb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_80e579() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_80e579();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl
new file mode 100644
index 0000000..38f6c35
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_81c19a() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_81c19a();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl
new file mode 100644
index 0000000..6377b97
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_81c19a() {
+ float4 res = arg_0.SampleBias(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0));
+}
+
+void fragment_main() {
+ textureSampleBias_81c19a();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl
new file mode 100644
index 0000000..3569b2b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_81c19a() {
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2());
+}
+
+fragment void fragment_main() {
+ textureSampleBias_81c19a();
+ return;
+}
+
+
+tint_Zl326D.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2());
+ ^
+tint_Zl326D.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm
new file mode 100644
index 0000000..84424e3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_81c19a "textureSampleBias_81c19a"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %19 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %23 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleBias_81c19a = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias|ConstOffset %float_1 %23
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleBias_81c19a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl
new file mode 100644
index 0000000..88ef14b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_81c19a() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_81c19a();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl
new file mode 100644
index 0000000..0972d0a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_d3fa1b() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_d3fa1b();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl
new file mode 100644
index 0000000..0702497
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_d3fa1b() {
+ float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleBias_d3fa1b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl
new file mode 100644
index 0000000..ee3b17b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_d3fa1b() {
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+}
+
+fragment void fragment_main() {
+ textureSampleBias_d3fa1b();
+ return;
+}
+
+
+tint_21BT87.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+ ^
+tint_21BT87.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm
new file mode 100644
index 0000000..563bd63
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_d3fa1b "textureSampleBias_d3fa1b"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %23 = OpConstantNull %v4float
+%textureSampleBias_d3fa1b = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %23
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSampleBias_d3fa1b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl
new file mode 100644
index 0000000..40dc89e
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_d3fa1b() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_d3fa1b();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl
new file mode 100644
index 0000000..dfd971b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_df91bb() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0, vec3<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_df91bb();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl
new file mode 100644
index 0000000..f6e85fc
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_df91bb() {
+ float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0));
+}
+
+void fragment_main() {
+ textureSampleBias_df91bb();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl
new file mode 100644
index 0000000..ca72483
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_df91bb() {
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3());
+}
+
+fragment void fragment_main() {
+ textureSampleBias_df91bb();
+ return;
+}
+
+
+tint_Y31ZCA.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3());
+ ^
+tint_Y31ZCA.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm
new file mode 100644
index 0000000..3b58d2d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_df91bb "textureSampleBias_df91bb"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %19 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %23 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleBias_df91bb = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias|ConstOffset %float_1 %23
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleBias_df91bb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl
new file mode 100644
index 0000000..c361dd7
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_df91bb() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1.0, vec3<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_df91bb();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl
new file mode 100644
index 0000000..3ab4bd6
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleBias_eed7c4() {
+ var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_eed7c4();
+}
diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl
new file mode 100644
index 0000000..06acc95
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleBias_eed7c4() {
+ float4 res = arg_0.SampleBias(arg_1, float4(float(1)), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleBias_eed7c4();
+ return;
+}
+
+
+tint_NFwEG1:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleBias(arg_1, float4(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl
new file mode 100644
index 0000000..37c07b0
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleBias_eed7c4() {
+ float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f));
+}
+
+fragment void fragment_main() {
+ textureSampleBias_eed7c4();
+ return;
+}
+
+
+tint_FJH9UG.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f));
+ ^
+tint_FJH9UG.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c1050e
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleBias_eed7c4 "textureSampleBias_eed7c4"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %16 = OpTypeSampledImage %3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+%textureSampleBias_eed7c4 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %14 = OpLoad %7 %arg_1
+ %15 = OpLoad %3 %arg_0
+ %17 = OpSampledImage %16 %15 %14
+ %18 = OpConvertSToF %float %int_1
+ %21 = OpCompositeConstruct %v4float %18
+ %12 = OpImageSampleImplicitLod %v4float %17 %21 Bias %float_1
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureSampleBias_eed7c4
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %21 = OpCompositeConstruct %v4float %18
+
diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl
new file mode 100644
index 0000000..c106d85
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleBias_eed7c4() {
+ var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleBias_eed7c4();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl
new file mode 100644
index 0000000..fb99c39
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler_comparison;
+fn textureSampleCompare_25fcd1() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_25fcd1();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl
new file mode 100644
index 0000000..c7283b2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_25fcd1() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0));
+}
+
+void fragment_main() {
+ textureSampleCompare_25fcd1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl
new file mode 100644
index 0000000..91fa073
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_25fcd1() {
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2());
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_25fcd1();
+ return;
+}
+
+
+tint_pEGMaq.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2());
+ ^
+tint_pEGMaq.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm
new file mode 100644
index 0000000..dcf0ce6
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm
@@ -0,0 +1,52 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_25fcd1 "textureSampleCompare_25fcd1"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %18 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %23 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpConstantNull %float
+%textureSampleCompare_25fcd1 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %26
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod|ConstOffset %float_0 %23
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleCompare_25fcd1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl
new file mode 100644
index 0000000..7beb7ef
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_25fcd1() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_25fcd1();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl
new file mode 100644
index 0000000..363f9e0
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler_comparison;
+fn textureSampleCompare_3a5923() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_3a5923();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl
new file mode 100644
index 0000000..051a7fe
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_3a5923() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float2(0.0f, 0.0f), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleCompare_3a5923();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl
new file mode 100644
index 0000000..f47fc85
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_3a5923() {
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f);
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_3a5923();
+ return;
+}
+
+
+tint_VUn9yJ.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f);
+ ^
+tint_VUn9yJ.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float2(), 1.0f);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm
new file mode 100644
index 0000000..cba7c59
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_3a5923 "textureSampleCompare_3a5923"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v2float = OpTypeVector %float 2
+ %18 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+%_ptr_Function_float = OpTypePointer Function %float
+ %23 = OpConstantNull %float
+%textureSampleCompare_3a5923 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %23
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod %float_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSampleCompare_3a5923
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl
new file mode 100644
index 0000000..a002ef2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_3a5923() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_3a5923();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl
new file mode 100644
index 0000000..bcc7e3a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+[[group(1), binding(1)]] var arg_1: sampler_comparison;
+fn textureSampleCompare_63fb83() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_63fb83();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl
new file mode 100644
index 0000000..29d85bd
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl
@@ -0,0 +1,12 @@
+TextureCube arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_63fb83() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleCompare_63fb83();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl
new file mode 100644
index 0000000..d3cbb77
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_63fb83() {
+ float res = arg_0.sample_compare(arg_1, float3(), 1.0f);
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_63fb83();
+ return;
+}
+
+
+tint_GIZRbk.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float3(), 1.0f);
+ ^
+tint_GIZRbk.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float3(), 1.0f);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm
new file mode 100644
index 0000000..b030b86
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm
@@ -0,0 +1,49 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_63fb83 "textureSampleCompare_63fb83"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %18 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+%_ptr_Function_float = OpTypePointer Function %float
+ %23 = OpConstantNull %float
+%textureSampleCompare_63fb83 = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %23
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod %float_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureSampleCompare_63fb83
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl
new file mode 100644
index 0000000..622f997
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_63fb83() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_63fb83();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl
new file mode 100644
index 0000000..18d36e3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_comparison;
+fn textureSampleCompare_98b85c() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_98b85c();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl
new file mode 100644
index 0000000..46b286d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_98b85c() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+}
+
+void fragment_main() {
+ textureSampleCompare_98b85c();
+ return;
+}
+
+
+tint_A6uvj1:5:54: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl
new file mode 100644
index 0000000..bf33ddb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_98b85c() {
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2());
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_98b85c();
+ return;
+}
+
+
+tint_MYN6rp.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2());
+ ^
+tint_MYN6rp.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c09a2bb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm
@@ -0,0 +1,62 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_98b85c "textureSampleCompare_98b85c"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+ %v2int = OpTypeVector %int 2
+ %25 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %28 = OpConstantNull %float
+%textureSampleCompare_98b85c = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %28
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %18 = OpConvertSToF %float %int_1
+ %21 = OpCompositeConstruct %v3float %18
+ %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod|ConstOffset %float_0 %25
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureSampleCompare_98b85c
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %21 = OpCompositeConstruct %v3float %18
+
diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl
new file mode 100644
index 0000000..6e6b107
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_98b85c() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_98b85c();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl
new file mode 100644
index 0000000..4f89419
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_comparison;
+fn textureSampleCompare_a3ca7e() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_a3ca7e();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl
new file mode 100644
index 0000000..750b7d3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_a3ca7e() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float4(float(1)), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleCompare_a3ca7e();
+ return;
+}
+
+
+tint_IPHMMc:5:54: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float res = arg_0.SampleCmpLevelZero(arg_1, float4(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl
new file mode 100644
index 0000000..7b69113
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_a3ca7e() {
+ float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f);
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_a3ca7e();
+ return;
+}
+
+
+tint_9kTJOr.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f);
+ ^
+tint_9kTJOr.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
new file mode 100644
index 0000000..a5d0103
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_a3ca7e "textureSampleCompare_a3ca7e"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpConstantNull %float
+%textureSampleCompare_a3ca7e = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %26
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %18 = OpConvertSToF %float %int_1
+ %21 = OpCompositeConstruct %v4float %18
+ %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod %float_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleCompare_a3ca7e
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %21 = OpCompositeConstruct %v4float %18
+
diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
new file mode 100644
index 0000000..2d8f4b1
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_a3ca7e() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_a3ca7e();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl
new file mode 100644
index 0000000..ec52adf
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl
@@ -0,0 +1,34 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_comparison;
+fn textureSampleCompare_dd431d() {
+ var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_dd431d();
+}
diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl
new file mode 100644
index 0000000..7c0e10b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerComparisonState arg_1 : register(s1, space1);
+
+void textureSampleCompare_dd431d() {
+ float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f);
+}
+
+void fragment_main() {
+ textureSampleCompare_dd431d();
+ return;
+}
+
+
+tint_7sR8gj:5:54: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl
new file mode 100644
index 0000000..21ecff4
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl
@@ -0,0 +1,25 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleCompare_dd431d() {
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f);
+}
+
+fragment void fragment_main() {
+ textureSampleCompare_dd431d();
+ return;
+}
+
+
+tint_QVzgbg.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f);
+ ^
+tint_QVzgbg.metal:5:36: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f);
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm
new file mode 100644
index 0000000..b5642d7
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleCompare_dd431d "textureSampleCompare_dd431d"
+ OpName %res "res"
+ OpName %fragment_main "fragment_main"
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %arg_1 DescriptorSet 1
+ OpDecorate %arg_1 Binding 1
+ %float = OpTypeFloat 32
+ %3 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
+ %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant
+ %7 = OpTypeSampler
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %15 = OpTypeSampledImage %3
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %float_0 = OpConstant %float 0
+%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpConstantNull %float
+%textureSampleCompare_dd431d = OpFunction %void None %8
+ %11 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %26
+ %13 = OpLoad %7 %arg_1
+ %14 = OpLoad %3 %arg_0
+ %16 = OpSampledImage %15 %14 %13
+ %18 = OpConvertSToF %float %int_1
+ %21 = OpCompositeConstruct %v3float %18
+ %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod %float_0
+ OpStore %res %12
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureSampleCompare_dd431d
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %21 = OpCompositeConstruct %v3float %18
+
diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl
new file mode 100644
index 0000000..8a292ad
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl
@@ -0,0 +1,12 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler_comparison;
+
+fn textureSampleCompare_dd431d() {
+ var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleCompare_dd431d();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl
new file mode 100644
index 0000000..9ed9bae
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_21402b() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_21402b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_21402b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_21402b();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl
new file mode 100644
index 0000000..5ad324f
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_21402b() {
+ float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl
new file mode 100644
index 0000000..57728da
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_21402b() {
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()));
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_21402b();
+ return;
+}
+
+
+tint_A4BTTm.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()));
+ ^
+tint_A4BTTm.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm
new file mode 100644
index 0000000..0241ae0
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_21402b "textureSampleGrad_21402b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_21402b = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleGrad_21402b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleGrad_21402b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleGrad_21402b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl
new file mode 100644
index 0000000..59d954e
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_21402b() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_21402b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_21402b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_21402b();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl
new file mode 100644
index 0000000..009ad75
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_2ecd8f() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), 1, vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_2ecd8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_2ecd8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_2ecd8f();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl
new file mode 100644
index 0000000..056e2ea
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_2ecd8f() {
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+
+tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^
+
+
+tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^
+
+
+tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl
new file mode 100644
index 0000000..97ce448
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_2ecd8f() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()));
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_2ecd8f();
+ return;
+}
+
+
+tint_sLu7kk.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()));
+ ^
+tint_sLu7kk.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..5b3a1db
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2float = OpTypeVector %float 2
+ %27 = OpConstantNull %v2float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %30 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_2ecd8f = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %30
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %22 = OpConvertSToF %float %int_1
+ %25 = OpCompositeConstruct %v3float %22
+ %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad %27 %27
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %32 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %34 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %25 = OpCompositeConstruct %v3float %22
+
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..eba29df
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_2ecd8f() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), 1, vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_2ecd8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_2ecd8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_2ecd8f();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl
new file mode 100644
index 0000000..2c535b9
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_468f88() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), vec2<f32>(), vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_468f88();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_468f88();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_468f88();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl
new file mode 100644
index 0000000..912a6da
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_468f88() {
+ float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl
new file mode 100644
index 0000000..984a782
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_468f88() {
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_468f88();
+ return;
+}
+
+
+tint_doTaaj.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2());
+ ^
+tint_doTaaj.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm
new file mode 100644
index 0000000..c112502
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_468f88 "textureSampleGrad_468f88"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %22 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %25 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_468f88 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %28
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleGrad_468f88
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleGrad_468f88
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleGrad_468f88
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl
new file mode 100644
index 0000000..3d447de
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_468f88() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), vec2<f32>(), vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_468f88();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_468f88();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_468f88();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl
new file mode 100644
index 0000000..bd953b6
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_521263() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_521263();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_521263();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_521263();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl
new file mode 100644
index 0000000..e877437
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_521263() {
+ float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl
new file mode 100644
index 0000000..8991aad
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_521263() {
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()));
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_521263();
+ return;
+}
+
+
+tint_WUNBbn.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()));
+ ^
+tint_WUNBbn.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm
new file mode 100644
index 0000000..daa1cf8
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_521263 "textureSampleGrad_521263"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %22 = OpConstantNull %v2float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_521263 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleGrad_521263
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleGrad_521263
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleGrad_521263
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl
new file mode 100644
index 0000000..283882b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_521263() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), vec2<f32>(), vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_521263();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_521263();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_521263();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl
new file mode 100644
index 0000000..e8f8c81
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_5312f4() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_5312f4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_5312f4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_5312f4();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl
new file mode 100644
index 0000000..add7e25
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_5312f4() {
+ float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl
new file mode 100644
index 0000000..e1c1253
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_5312f4() {
+ float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3()));
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_5312f4();
+ return;
+}
+
+
+tint_ktuoWy.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3()));
+ ^
+tint_ktuoWy.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3()));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm
new file mode 100644
index 0000000..018f69a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %25 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_5312f4 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %25
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleGrad_5312f4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleGrad_5312f4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleGrad_5312f4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl
new file mode 100644
index 0000000..fe32c14
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_5312f4() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_5312f4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_5312f4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_5312f4();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl
new file mode 100644
index 0000000..3c64dda
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_872f00() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), 1, vec2<f32>(), vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_872f00();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_872f00();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_872f00();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl
new file mode 100644
index 0000000..c777f65
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_872f00() {
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+
+tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
+ ^
+
+
+tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
+ ^
+
+
+tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl
new file mode 100644
index 0000000..57e6ed3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_872f00() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_872f00();
+ return;
+}
+
+
+tint_9yqds2.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2());
+ ^
+tint_9yqds2.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9742e4
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_872f00 "textureSampleGrad_872f00"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2float = OpTypeVector %float 2
+ %27 = OpConstantNull %v2float
+ %v2int = OpTypeVector %int 2
+ %29 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %32 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_872f00 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %32
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %22 = OpConvertSToF %float %int_1
+ %25 = OpCompositeConstruct %v3float %22
+ %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad|ConstOffset %27 %27 %29
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %34 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %36 = OpFunctionCall %void %textureSampleGrad_872f00
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleGrad_872f00
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_872f00
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %25 = OpCompositeConstruct %v3float %22
+
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl
new file mode 100644
index 0000000..1519468
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_872f00() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(), 1, vec2<f32>(), vec2<f32>(), vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_872f00();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_872f00();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_872f00();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl
new file mode 100644
index 0000000..dd1843c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_e383db() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), 1, vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_e383db();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_e383db();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_e383db();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl
new file mode 100644
index 0000000..4824676
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_e383db() {
+ float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+
+tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^
+
+
+tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^
+
+
+tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl
new file mode 100644
index 0000000..12a18a8
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_e383db() {
+ float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3()));
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_e383db();
+ return;
+}
+
+
+tint_2um7ce.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3()));
+ ^
+tint_2um7ce.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3()));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm
new file mode 100644
index 0000000..62e786b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_e383db "textureSampleGrad_e383db"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v3float = OpTypeVector %float 3
+ %26 = OpConstantNull %v3float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_e383db = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %29
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %21 = OpConvertSToF %float %int_1
+ %24 = OpCompositeConstruct %v4float %21
+ %15 = OpImageSampleExplicitLod %v4float %20 %24 Grad %26 %26
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %31 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %33 = OpFunctionCall %void %textureSampleGrad_e383db
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureSampleGrad_e383db
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleGrad_e383db
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %24 = OpCompositeConstruct %v4float %21
+
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl
new file mode 100644
index 0000000..a528a16
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_e383db() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), 1, vec3<f32>(), vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_e383db();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_e383db();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_e383db();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl
new file mode 100644
index 0000000..0570dd9
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleGrad_e9a2f7() {
+ var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_e9a2f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_e9a2f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_e9a2f7();
+}
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl
new file mode 100644
index 0000000..aeb9445
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleGrad_e9a2f7() {
+ float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0));
+}
+
+void vertex_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
+void fragment_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl
new file mode 100644
index 0000000..a0423e8
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleGrad_e9a2f7() {
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3());
+}
+
+vertex void vertex_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleGrad_e9a2f7();
+ return;
+}
+
+
+tint_XTrY0h.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3());
+ ^
+tint_XTrY0h.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..e523af4
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleGrad_e9a2f7 "textureSampleGrad_e9a2f7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %25 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleGrad_e9a2f7 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %28
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..e92d43a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleGrad_e9a2f7() {
+ var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(), vec3<f32>(), vec3<f32>(), vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleGrad_e9a2f7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleGrad_e9a2f7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleGrad_e9a2f7();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl
new file mode 100644
index 0000000..b557f04
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_02be59() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_02be59();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_02be59();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_02be59();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl
new file mode 100644
index 0000000..e67e8af
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_02be59() {
+ float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1);
+}
+
+void vertex_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl
new file mode 100644
index 0000000..2f21bc3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_02be59() {
+ float res = arg_0.sample(arg_1, float2(), level(1));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_02be59();
+ return;
+}
+
+
+tint_MlSwdA.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), level(1));
+ ^
+tint_MlSwdA.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), level(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm
new file mode 100644
index 0000000..de6563c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %23 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_02be59 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %24 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_02be59
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_02be59
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_02be59
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2f0d11
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_02be59() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_02be59();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_02be59();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_02be59();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl
new file mode 100644
index 0000000..d7dd70b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_0bdd9a() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_0bdd9a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_0bdd9a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_0bdd9a();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl
new file mode 100644
index 0000000..f81fbbb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_0bdd9a() {
+ float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+
+tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f);
+ ^
+
+
+tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f);
+ ^
+
+
+tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl
new file mode 100644
index 0000000..6880ef2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_0bdd9a() {
+ float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_0bdd9a();
+ return;
+}
+
+
+tint_y7pPKt.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f));
+ ^
+tint_y7pPKt.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc17e05
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %28 = OpConstantNull %v4float
+%textureSampleLevel_0bdd9a = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %28
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %21 = OpConvertSToF %float %int_1
+ %24 = OpCompositeConstruct %v4float %21
+ %15 = OpImageSampleExplicitLod %v4float %20 %24 Lod %float_1
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %31 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %24 = OpCompositeConstruct %v4float %21
+
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
new file mode 100644
index 0000000..1e77805
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_0bdd9a() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_0bdd9a();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_0bdd9a();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_0bdd9a();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl
new file mode 100644
index 0000000..e983a8c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_cube;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_1b0291() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_1b0291();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_1b0291();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_1b0291();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl
new file mode 100644
index 0000000..dd4acbf
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+TextureCube arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_1b0291() {
+ float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1);
+}
+
+void vertex_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl
new file mode 100644
index 0000000..da76cd6
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_1b0291() {
+ float res = arg_0.sample(arg_1, float3(), level(1));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_1b0291();
+ return;
+}
+
+
+tint_i62KS7.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float3(), level(1));
+ ^
+tint_i62KS7.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float3(), level(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm
new file mode 100644
index 0000000..a0202c2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %23 = OpConstantNull %v3float
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_1b0291 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %24 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_1b0291
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_1b0291
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_1b0291
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl
new file mode 100644
index 0000000..e24aebb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_1b0291() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_1b0291();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_1b0291();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_1b0291();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl
new file mode 100644
index 0000000..cbb37ce
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_1bf73e() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_1bf73e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_1bf73e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_1bf73e();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl
new file mode 100644
index 0000000..adfe0a7
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl
@@ -0,0 +1,52 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_1bf73e() {
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+}
+
+void vertex_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+
+tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+
+
+tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+
+
+tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl
new file mode 100644
index 0000000..c5e9d5a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_1bf73e() {
+ float res = arg_0.sample(arg_1, float2(), 1, level(1));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_1bf73e();
+ return;
+}
+
+
+tint_tekcGc.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), 1, level(1));
+ ^
+tint_tekcGc.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), 1, level(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm
new file mode 100644
index 0000000..39175d8
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_1bf73e = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %23 = OpConvertSToF %float %int_1
+ %26 = OpCompositeConstruct %v3float %23
+ %27 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod %27
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %31 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %33 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %26 = OpCompositeConstruct %v3float %23
+
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl
new file mode 100644
index 0000000..c76783b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_1bf73e() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_1bf73e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_1bf73e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_1bf73e();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl
new file mode 100644
index 0000000..8c7e833
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_302be4() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_302be4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_302be4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_302be4();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl
new file mode 100644
index 0000000..bcca58d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_302be4() {
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+
+tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f);
+ ^
+
+
+tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f);
+ ^
+
+
+tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl
new file mode 100644
index 0000000..06532a1
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_302be4() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_302be4();
+ return;
+}
+
+
+tint_tJxVCK.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f));
+ ^
+tint_tJxVCK.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm
new file mode 100644
index 0000000..1569494
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpConstantNull %v4float
+%textureSampleLevel_302be4 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %29
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %22 = OpConvertSToF %float %int_1
+ %25 = OpCompositeConstruct %v3float %22
+ %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod %float_1
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %31 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_302be4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_302be4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_302be4
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %25 = OpCompositeConstruct %v3float %22
+
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl
new file mode 100644
index 0000000..e2c86f1
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_302be4() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_302be4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_302be4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_302be4();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl
new file mode 100644
index 0000000..20c5d2d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_depth_2d;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_47daa4() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_47daa4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_47daa4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_47daa4();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl
new file mode 100644
index 0000000..1fa7f91
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_47daa4() {
+ float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl
new file mode 100644
index 0000000..62a1918
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_47daa4() {
+ float res = arg_0.sample(arg_1, float2(), level(1), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_47daa4();
+ return;
+}
+
+
+tint_NueDXP.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), level(1), int2());
+ ^
+tint_NueDXP.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), level(1), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm
new file mode 100644
index 0000000..237ca8a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_47daa4 "textureSampleLevel_47daa4"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %23 = OpConstantNull %v2float
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2int = OpTypeVector %int 2
+ %28 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_47daa4 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %24 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod|ConstOffset %24 %28
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %32 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %34 = OpFunctionCall %void %textureSampleLevel_47daa4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureSampleLevel_47daa4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureSampleLevel_47daa4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c3690f
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_47daa4() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_47daa4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_47daa4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_47daa4();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl
new file mode 100644
index 0000000..17be2cb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_690d95() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_690d95();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_690d95();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_690d95();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl
new file mode 100644
index 0000000..104391c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_690d95() {
+ float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl
new file mode 100644
index 0000000..d1c3c2b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_690d95() {
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_690d95();
+ return;
+}
+
+
+tint_QmnI4P.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2());
+ ^
+tint_QmnI4P.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm
new file mode 100644
index 0000000..459833d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_690d95 "textureSampleLevel_690d95"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %22 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %26 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpConstantNull %v4float
+%textureSampleLevel_690d95 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %29
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %31 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_690d95
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_690d95
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_690d95
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl
new file mode 100644
index 0000000..6296395
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_690d95() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1.0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_690d95();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_690d95();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_690d95();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl
new file mode 100644
index 0000000..ca08cfa
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_external;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_979816() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_979816();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_979816();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_979816();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl
new file mode 100644
index 0000000..3955bcf
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_979816() {
+ float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 0.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl
new file mode 100644
index 0000000..fb4f072
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_979816() {
+ float4 res = arg_0.sample(arg_1, float2(), level(0.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_979816();
+ return;
+}
+
+
+tint_iGu5by.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), level(0.0f));
+ ^
+tint_iGu5by.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), level(0.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm
new file mode 100644
index 0000000..13c9866
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm
@@ -0,0 +1,71 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_979816 "textureSampleLevel_979816"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %22 = OpConstantNull %v2float
+ %float_0 = OpConstant %float 0
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_979816 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %30 = OpFunctionCall %void %textureSampleLevel_979816
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureSampleLevel_979816
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureSampleLevel_979816
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl
new file mode 100644
index 0000000..aef0711
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : external_texture;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_979816() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_979816();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_979816();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_979816();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl
new file mode 100644
index 0000000..edd4bab
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_9bd37b() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_9bd37b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_9bd37b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_9bd37b();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl
new file mode 100644
index 0000000..b0833fb
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_9bd37b() {
+ float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0));
+}
+
+void vertex_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl
new file mode 100644
index 0000000..75bb3f3
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_9bd37b() {
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3());
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_9bd37b();
+ return;
+}
+
+
+tint_F0xrSV.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3());
+ ^
+tint_F0xrSV.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm
new file mode 100644
index 0000000..fbc52c7
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_9bd37b "textureSampleLevel_9bd37b"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %26 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpConstantNull %v4float
+%textureSampleLevel_9bd37b = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %29
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %31 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_9bd37b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_9bd37b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_9bd37b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c8d0cb1
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_9bd37b() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0, vec3<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_9bd37b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_9bd37b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_9bd37b();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl
new file mode 100644
index 0000000..cbda792
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d_array<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_a4af26() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_a4af26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_a4af26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_a4af26();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl
new file mode 100644
index 0000000..77c9671
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl
@@ -0,0 +1,43 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_a4af26() {
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+
+tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+ ^
+
+
+tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+ ^
+
+
+tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl
new file mode 100644
index 0000000..dd8a62e
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_a4af26() {
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_a4af26();
+ return;
+}
+
+
+tint_SXV7wz.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2());
+ ^
+tint_SXV7wz.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e4d041
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_a4af26 "textureSampleLevel_a4af26"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %v2int = OpTypeVector %int 2
+ %28 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpConstantNull %v4float
+%textureSampleLevel_a4af26 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %31
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %22 = OpConvertSToF %float %int_1
+ %25 = OpCompositeConstruct %v3float %22
+ %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod|ConstOffset %float_1 %28
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %33 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %34 = OpFunctionCall %void %textureSampleLevel_a4af26
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureSampleLevel_a4af26
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureSampleLevel_a4af26
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %25 = OpCompositeConstruct %v3float %22
+
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl
new file mode 100644
index 0000000..db51737
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d_array<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_a4af26() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1.0, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_a4af26();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_a4af26();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_a4af26();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl
new file mode 100644
index 0000000..ad8f483
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_3d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_abfcc0() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_abfcc0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_abfcc0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_abfcc0();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl
new file mode 100644
index 0000000..8ec0780
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_abfcc0() {
+ float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl
new file mode 100644
index 0000000..5e889aa
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_abfcc0() {
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_abfcc0();
+ return;
+}
+
+
+tint_Utz1cx.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+ ^
+tint_Utz1cx.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm
new file mode 100644
index 0000000..9ad4e35
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleLevel_abfcc0 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleLevel_abfcc0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleLevel_abfcc0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_abfcc0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl
new file mode 100644
index 0000000..0613aea
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_3d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_abfcc0() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_abfcc0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_abfcc0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_abfcc0();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl
new file mode 100644
index 0000000..36ed893
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_ae5e39() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_ae5e39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_ae5e39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_ae5e39();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl
new file mode 100644
index 0000000..e9fe818
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl
@@ -0,0 +1,52 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+TextureCubeArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_ae5e39() {
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+}
+
+void vertex_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+
+tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+
+
+tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+
+
+tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1);
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl
new file mode 100644
index 0000000..f37b48b
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_ae5e39() {
+ float res = arg_0.sample(arg_1, float3(), 1, level(1));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_ae5e39();
+ return;
+}
+
+
+tint_mqWfoh.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float3(), 1, level(1));
+ ^
+tint_mqWfoh.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float3(), 1, level(1));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm
new file mode 100644
index 0000000..1cc06da
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_ae5e39 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %22 = OpConvertSToF %float %int_1
+ %25 = OpCompositeConstruct %v4float %22
+ %26 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %25 Lod %26
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %25 = OpCompositeConstruct %v4float %22
+
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl
new file mode 100644
index 0000000..aaca367
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_ae5e39() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1, 1);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_ae5e39();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_ae5e39();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_ae5e39();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl
new file mode 100644
index 0000000..c25cf35
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// 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_ba93b3() {
+ var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_ba93b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_ba93b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_ba93b3();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl
new file mode 100644
index 0000000..f6e94c5
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl
@@ -0,0 +1,48 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+Texture2DArray arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_ba93b3() {
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+}
+
+void vertex_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+
+tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+ ^
+tint_yH0jAE:5:9: warning: implicit tru
+tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+ ^
+tint_yH0jAE:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+ ^
+
+
+tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1)
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+ ^
+tint_yH0jAE:5:9: warning: implicit truncation of vector type [-Wconversion]
+ float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0));
+ ^
+
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl
new file mode 100644
index 0000000..3c49e31
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_ba93b3() {
+ float res = arg_0.sample(arg_1, float2(), 1, level(1), int2());
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_ba93b3();
+ return;
+}
+
+
+tint_HAD0Zn.metal:5:15: error: use of undeclared identifier 'arg_0'
+ float res = arg_0.sample(arg_1, float2(), 1, level(1), int2());
+ ^
+tint_HAD0Zn.metal:5:28: error: use of undeclared identifier 'arg_1'
+ float res = arg_0.sample(arg_1, float2(), 1, level(1), int2());
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..d249923
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+SKIP: FAILED
+
+; 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" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_ba93b3 "textureSampleLevel_ba93b3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 1 1 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %20 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v2int = OpTypeVector %int 2
+ %29 = OpConstantNull %v2int
+%_ptr_Function_float = OpTypePointer Function %float
+ %float_1 = OpConstant %float 1
+%textureSampleLevel_ba93b3 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %18 = OpLoad %10 %arg_1
+ %19 = OpLoad %7 %arg_0
+ %21 = OpSampledImage %20 %19 %18
+ %23 = OpConvertSToF %float %int_1
+ %26 = OpCompositeConstruct %v3float %23
+ %27 = OpConvertSToF %float %int_1
+ %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod|ConstOffset %27 %29
+ %15 = OpCompositeExtract %float %16 0
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %33 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %35 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: Expected number of constituents to be at least 2
+ %26 = OpCompositeConstruct %v3float %23
+
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..de65319
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_ba93b3() {
+ var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1, 1, vec2<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_ba93b3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_ba93b3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_ba93b3();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl
new file mode 100644
index 0000000..d510ee8
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_cube<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_c32df7() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_c32df7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_c32df7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_c32df7();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl
new file mode 100644
index 0000000..dddaff2
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_c32df7() {
+ float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl
new file mode 100644
index 0000000..02d477c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_c32df7() {
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_c32df7();
+ return;
+}
+
+
+tint_OIsoHc.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+ ^
+tint_OIsoHc.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float3(), level(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm
new file mode 100644
index 0000000..e16c043
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v3float = OpTypeVector %float 3
+ %22 = OpConstantNull %v3float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleLevel_c32df7 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleLevel_c32df7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleLevel_c32df7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_c32df7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl
new file mode 100644
index 0000000..556751a
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_cube<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_c32df7() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_c32df7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_c32df7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_c32df7();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl
new file mode 100644
index 0000000..39e1e8c
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_2d<f32>;
+[[group(1), binding(1)]] var arg_1: sampler;
+fn textureSampleLevel_c6aca6() {
+ var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_c6aca6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_c6aca6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_c6aca6();
+}
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl
new file mode 100644
index 0000000..6e7600d
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl
@@ -0,0 +1,23 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+SamplerState arg_1 : register(s1, space1);
+
+void textureSampleLevel_c6aca6() {
+ float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f);
+}
+
+void vertex_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
+void fragment_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl
new file mode 100644
index 0000000..4e4b5a4
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl
@@ -0,0 +1,35 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureSampleLevel_c6aca6() {
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f));
+}
+
+vertex void vertex_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
+kernel void compute_main() {
+ textureSampleLevel_c6aca6();
+ return;
+}
+
+
+tint_fS8Xzw.metal:5:16: error: use of undeclared identifier 'arg_0'
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f));
+ ^
+tint_fS8Xzw.metal:5:29: error: use of undeclared identifier 'arg_1'
+ float4 res = arg_0.sample(arg_1, float2(), level(1.0f));
+ ^
+2 errors generated.
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm
new file mode 100644
index 0000000..9404477
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %arg_1 "arg_1"
+ OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize 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
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %void = OpTypeVoid
+ %11 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %19 = OpTypeSampledImage %7
+ %v2float = OpTypeVector %float 2
+ %22 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %26 = OpConstantNull %v4float
+%textureSampleLevel_c6aca6 = OpFunction %void None %11
+ %14 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %26
+ %17 = OpLoad %10 %arg_1
+ %18 = OpLoad %7 %arg_0
+ %20 = OpSampledImage %19 %18 %17
+ %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %11
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %textureSampleLevel_c6aca6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %11
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureSampleLevel_c6aca6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %11
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureSampleLevel_c6aca6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl
new file mode 100644
index 0000000..3baacae
--- /dev/null
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+[[group(1), binding(0)]] var arg_0 : texture_2d<f32>;
+
+[[group(1), binding(1)]] var arg_1 : sampler;
+
+fn textureSampleLevel_c6aca6() {
+ var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(), 1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureSampleLevel_c6aca6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureSampleLevel_c6aca6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureSampleLevel_c6aca6();
+}
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl
new file mode 100644
index 0000000..f0df428
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32float, write>;
+fn textureStore_05ce15() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_05ce15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_05ce15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_05ce15();
+}
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl
new file mode 100644
index 0000000..d38cd87
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_05ce15() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_05ce15();
+ return;
+}
+
+void fragment_main() {
+ textureStore_05ce15();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_05ce15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl
new file mode 100644
index 0000000..6882d81
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_05ce15() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_05ce15();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_05ce15();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_05ce15();
+ return;
+}
+
+
+tint_9eeMzw.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9b79d5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_05ce15 "textureStore_05ce15"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_05ce15 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_05ce15
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_05ce15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_05ce15
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl
new file mode 100644
index 0000000..75c0ae2
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32float>;
+
+fn textureStore_05ce15() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_05ce15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_05ce15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_05ce15();
+}
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl
new file mode 100644
index 0000000..caa9253
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32float, write>;
+fn textureStore_064c7f() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_064c7f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_064c7f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_064c7f();
+}
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl
new file mode 100644
index 0000000..85108a6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_064c7f() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_064c7f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_064c7f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_064c7f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl
new file mode 100644
index 0000000..65538ec
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_064c7f() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_064c7f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_064c7f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_064c7f();
+ return;
+}
+
+
+tint_HPJeZt.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm
new file mode 100644
index 0000000..97edb60
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_064c7f "textureStore_064c7f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_064c7f = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_064c7f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_064c7f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_064c7f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl
new file mode 100644
index 0000000..500c2a1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32float>;
+
+fn textureStore_064c7f() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_064c7f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_064c7f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_064c7f();
+}
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl
new file mode 100644
index 0000000..b5a277b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/068641.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16uint, write>;
+fn textureStore_068641() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_068641();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_068641();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_068641();
+}
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl
new file mode 100644
index 0000000..e744a5e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_068641() {
+ arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_068641();
+ return;
+}
+
+void fragment_main() {
+ textureStore_068641();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_068641();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl
new file mode 100644
index 0000000..4b9e7b9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_068641() {
+ arg_0.write(uint4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_068641();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_068641();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_068641();
+ return;
+}
+
+
+tint_yRIG80.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm
new file mode 100644
index 0000000..17de556
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_068641 "textureStore_068641"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_068641 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_068641
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_068641
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_068641
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl
new file mode 100644
index 0000000..1cff6cd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16uint>;
+
+fn textureStore_068641() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_068641();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_068641();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_068641();
+}
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl
new file mode 100644
index 0000000..dbcb216
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32float, write>;
+fn textureStore_0af6b5() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_0af6b5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_0af6b5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_0af6b5();
+}
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl
new file mode 100644
index 0000000..6e80c55
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_0af6b5() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_0af6b5();
+ return;
+}
+
+void fragment_main() {
+ textureStore_0af6b5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0af6b5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl
new file mode 100644
index 0000000..cb8727b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0af6b5() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_0af6b5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_0af6b5();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_0af6b5();
+ return;
+}
+
+
+tint_XLLIfe.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm
new file mode 100644
index 0000000..d651f50
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0af6b5 "textureStore_0af6b5"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_0af6b5 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_0af6b5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_0af6b5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_0af6b5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl
new file mode 100644
index 0000000..dedf0b6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32float>;
+
+fn textureStore_0af6b5() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_0af6b5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_0af6b5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_0af6b5();
+}
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl
new file mode 100644
index 0000000..b6189de
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16uint, write>;
+fn textureStore_0c3dff() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_0c3dff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_0c3dff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_0c3dff();
+}
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl
new file mode 100644
index 0000000..dcc9b15
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_0c3dff() {
+ arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_0c3dff();
+ return;
+}
+
+void fragment_main() {
+ textureStore_0c3dff();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0c3dff();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl
new file mode 100644
index 0000000..9290996
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0c3dff() {
+ arg_0.write(uint4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_0c3dff();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_0c3dff();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_0c3dff();
+ return;
+}
+
+
+tint_U5Oofe.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm
new file mode 100644
index 0000000..32263fd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0c3dff "textureStore_0c3dff"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_0c3dff = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_0c3dff
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_0c3dff
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_0c3dff
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl
new file mode 100644
index 0000000..6420eaf
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16uint>;
+
+fn textureStore_0c3dff() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_0c3dff();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_0c3dff();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_0c3dff();
+}
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl
new file mode 100644
index 0000000..c1c0bf4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/102722.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32uint, write>;
+fn textureStore_102722() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_102722();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_102722();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_102722();
+}
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl
new file mode 100644
index 0000000..bfbb63b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_102722() {
+ arg_0[1] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_102722();
+ return;
+}
+
+void fragment_main() {
+ textureStore_102722();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_102722();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl
new file mode 100644
index 0000000..dc52f88
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_102722() {
+ arg_0.write(uint4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_102722();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_102722();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_102722();
+ return;
+}
+
+
+tint_FWnulI.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm
new file mode 100644
index 0000000..0406d15
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_102722 "textureStore_102722"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %18 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_102722 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_102722
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_102722
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_102722
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl
new file mode 100644
index 0000000..bab8dc4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32uint>;
+
+fn textureStore_102722() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_102722();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_102722();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_102722();
+}
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl
new file mode 100644
index 0000000..5296393
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8unorm, write>;
+fn textureStore_1bbd08() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_1bbd08();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_1bbd08();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_1bbd08();
+}
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl
new file mode 100644
index 0000000..561bce9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_1bbd08() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_1bbd08();
+ return;
+}
+
+void fragment_main() {
+ textureStore_1bbd08();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1bbd08();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl
new file mode 100644
index 0000000..e5f3aa7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1bbd08() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_1bbd08();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_1bbd08();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_1bbd08();
+ return;
+}
+
+
+tint_dwpRke.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm
new file mode 100644
index 0000000..9bde491
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1bbd08 "textureStore_1bbd08"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_1bbd08 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_1bbd08
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_1bbd08
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_1bbd08
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl
new file mode 100644
index 0000000..0b676c2
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8unorm>;
+
+fn textureStore_1bbd08() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_1bbd08();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_1bbd08();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_1bbd08();
+}
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl
new file mode 100644
index 0000000..0170e00
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32sint, write>;
+fn textureStore_1c02e7() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_1c02e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_1c02e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_1c02e7();
+}
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl
new file mode 100644
index 0000000..dbbaade
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_1c02e7() {
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+void fragment_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+
+tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl
new file mode 100644
index 0000000..61d0b7a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1c02e7() {
+ arg_0.write(int4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_1c02e7();
+ return;
+}
+
+
+tint_CpbCeH.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..c842521
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1c02e7 "textureStore_1c02e7"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4int = OpTypeVector %int 4
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_1c02e7 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_1c02e7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_1c02e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_1c02e7
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..715524f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32sint>;
+
+fn textureStore_1c02e7() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_1c02e7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_1c02e7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_1c02e7();
+}
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl
new file mode 100644
index 0000000..815e628
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8uint, write>;
+fn textureStore_22d955() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_22d955();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_22d955();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_22d955();
+}
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl
new file mode 100644
index 0000000..cf011fc
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_22d955() {
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_22d955();
+ return;
+}
+
+void fragment_main() {
+ textureStore_22d955();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_22d955();
+ return;
+}
+
+
+tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl
new file mode 100644
index 0000000..cd4b05eb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_22d955() {
+ arg_0.write(uint4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_22d955();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_22d955();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_22d955();
+ return;
+}
+
+
+tint_4GbpDy.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm
new file mode 100644
index 0000000..710de9a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_22d955 "textureStore_22d955"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+ %v4uint = OpTypeVector %uint 4
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_22d955 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %18 %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureStore_22d955
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_22d955
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_22d955
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl
new file mode 100644
index 0000000..08c8bb1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8uint>;
+
+fn textureStore_22d955() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_22d955();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_22d955();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_22d955();
+}
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl
new file mode 100644
index 0000000..693d8e8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32uint, write>;
+fn textureStore_26bf70() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_26bf70();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_26bf70();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_26bf70();
+}
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl
new file mode 100644
index 0000000..8a9bbda
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_26bf70() {
+ arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_26bf70();
+ return;
+}
+
+void fragment_main() {
+ textureStore_26bf70();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_26bf70();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl
new file mode 100644
index 0000000..30ff0a8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_26bf70() {
+ arg_0.write(uint4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_26bf70();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_26bf70();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_26bf70();
+ return;
+}
+
+
+tint_u7QeEL.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a8ef15
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_26bf70 "textureStore_26bf70"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_26bf70 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_26bf70
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_26bf70
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_26bf70
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1ff649
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32uint>;
+
+fn textureStore_26bf70() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_26bf70();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_26bf70();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_26bf70();
+}
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl
new file mode 100644
index 0000000..3b2e3b2
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32sint, write>;
+fn textureStore_2796b4() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2796b4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2796b4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2796b4();
+}
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl
new file mode 100644
index 0000000..88e1e0f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureStore_2796b4() {
+ arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_2796b4();
+ return;
+}
+
+void fragment_main() {
+ textureStore_2796b4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2796b4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl
new file mode 100644
index 0000000..aff37f8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2796b4() {
+ arg_0.write(int4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_2796b4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_2796b4();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_2796b4();
+ return;
+}
+
+
+tint_hHByVz.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm
new file mode 100644
index 0000000..e26f6b6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2796b4 "textureStore_2796b4"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_2796b4 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_2796b4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_2796b4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_2796b4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl
new file mode 100644
index 0000000..d307706
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32sint>;
+
+fn textureStore_2796b4() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2796b4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2796b4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2796b4();
+}
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl
new file mode 100644
index 0000000..7a5200f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32float, write>;
+fn textureStore_2ac6c7() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2ac6c7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2ac6c7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2ac6c7();
+}
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl
new file mode 100644
index 0000000..2e5bd83
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2ac6c7() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
+void fragment_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl
new file mode 100644
index 0000000..c73714b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2ac6c7() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_2ac6c7();
+ return;
+}
+
+
+tint_FUFaCJ.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm
new file mode 100644
index 0000000..6a05c5c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2ac6c7 "textureStore_2ac6c7"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_2ac6c7 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_2ac6c7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_2ac6c7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_2ac6c7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl
new file mode 100644
index 0000000..7d3f57a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32float>;
+
+fn textureStore_2ac6c7() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2ac6c7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2ac6c7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2ac6c7();
+}
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl
new file mode 100644
index 0000000..2f4f9d7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16uint, write>;
+fn textureStore_2eb2a4() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2eb2a4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2eb2a4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2eb2a4();
+}
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl
new file mode 100644
index 0000000..2bfcdeb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_2eb2a4() {
+ arg_0[1] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
+void fragment_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl
new file mode 100644
index 0000000..87d35c0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2eb2a4() {
+ arg_0.write(uint4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_2eb2a4();
+ return;
+}
+
+
+tint_PNmP6G.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..fd59253
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2eb2a4 "textureStore_2eb2a4"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %18 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_2eb2a4 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_2eb2a4
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_2eb2a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_2eb2a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..f62d137
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16uint>;
+
+fn textureStore_2eb2a4() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2eb2a4();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2eb2a4();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2eb2a4();
+}
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl
new file mode 100644
index 0000000..c710a47
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8snorm, write>;
+fn textureStore_2ed2a3() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2ed2a3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2ed2a3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2ed2a3();
+}
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl
new file mode 100644
index 0000000..61caf3b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2ed2a3() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
+void fragment_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl
new file mode 100644
index 0000000..c592342
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2ed2a3() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_2ed2a3();
+ return;
+}
+
+
+tint_k1UauU.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm
new file mode 100644
index 0000000..3c4624c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2ed2a3 "textureStore_2ed2a3"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_2ed2a3 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_2ed2a3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_2ed2a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_2ed2a3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl
new file mode 100644
index 0000000..366b088
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8snorm>;
+
+fn textureStore_2ed2a3() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_2ed2a3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_2ed2a3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_2ed2a3();
+}
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl
new file mode 100644
index 0000000..be9ae40
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32sint, write>;
+fn textureStore_31745b() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_31745b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_31745b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_31745b();
+}
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl
new file mode 100644
index 0000000..2205238
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureStore_31745b() {
+ arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_31745b();
+ return;
+}
+
+void fragment_main() {
+ textureStore_31745b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_31745b();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl
new file mode 100644
index 0000000..b29dadb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_31745b() {
+ arg_0.write(int4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_31745b();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_31745b();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_31745b();
+ return;
+}
+
+
+tint_4hXtaI.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm
new file mode 100644
index 0000000..101f8dd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_31745b "textureStore_31745b"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_31745b = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_31745b
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_31745b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_31745b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl
new file mode 100644
index 0000000..fc1848f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32sint>;
+
+fn textureStore_31745b() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_31745b();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_31745b();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_31745b();
+}
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl
new file mode 100644
index 0000000..82fea17
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16float, write>;
+fn textureStore_32f368() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_32f368();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_32f368();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_32f368();
+}
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl
new file mode 100644
index 0000000..f15b94b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_32f368() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_32f368();
+ return;
+}
+
+void fragment_main() {
+ textureStore_32f368();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_32f368();
+ return;
+}
+
+
+tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl
new file mode 100644
index 0000000..d915feb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_32f368() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_32f368();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_32f368();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_32f368();
+ return;
+}
+
+
+tint_bxPhKa.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm
new file mode 100644
index 0000000..d8b5b0d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_32f368 "textureStore_32f368"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_32f368 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_32f368
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_32f368
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_32f368
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl
new file mode 100644
index 0000000..43d6af5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16float>;
+
+fn textureStore_32f368() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_32f368();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_32f368();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_32f368();
+}
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl
new file mode 100644
index 0000000..f4bf4e4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32float, write>;
+fn textureStore_331aee() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_331aee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_331aee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_331aee();
+}
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl
new file mode 100644
index 0000000..ef51064
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_331aee() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_331aee();
+ return;
+}
+
+void fragment_main() {
+ textureStore_331aee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_331aee();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl
new file mode 100644
index 0000000..975862c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_331aee() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_331aee();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_331aee();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_331aee();
+ return;
+}
+
+
+tint_kixkHt.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm
new file mode 100644
index 0000000..1c6d255
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_331aee "textureStore_331aee"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_331aee = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_331aee
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_331aee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_331aee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1ed0c6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32float>;
+
+fn textureStore_331aee() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_331aee();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_331aee();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_331aee();
+}
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl
new file mode 100644
index 0000000..e6bb103
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32uint, write>;
+fn textureStore_38e8d7() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_38e8d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_38e8d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_38e8d7();
+}
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl
new file mode 100644
index 0000000..269ec63
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_38e8d7() {
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+void fragment_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+
+tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl
new file mode 100644
index 0000000..a29fc29
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_38e8d7() {
+ arg_0.write(uint4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_38e8d7();
+ return;
+}
+
+
+tint_x2IjFo.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm
new file mode 100644
index 0000000..d5e69af
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_38e8d7 "textureStore_38e8d7"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+ %v4uint = OpTypeVector %uint 4
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_38e8d7 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %18 %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureStore_38e8d7
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_38e8d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_38e8d7
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl
new file mode 100644
index 0000000..50a53ca
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32uint>;
+
+fn textureStore_38e8d7() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_38e8d7();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_38e8d7();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_38e8d7();
+}
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl
new file mode 100644
index 0000000..c815964
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16sint, write>;
+fn textureStore_3a52ac() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3a52ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3a52ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3a52ac();
+}
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl
new file mode 100644
index 0000000..e40d375
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_3a52ac() {
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+void fragment_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+
+tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl
new file mode 100644
index 0000000..1468a7e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_3a52ac() {
+ arg_0.write(int4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_3a52ac();
+ return;
+}
+
+
+tint_N2pxwW.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm
new file mode 100644
index 0000000..91f568d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_3a52ac "textureStore_3a52ac"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4int = OpTypeVector %int 4
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_3a52ac = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_3a52ac
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_3a52ac
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_3a52ac
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl
new file mode 100644
index 0000000..85d39aa
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16sint>;
+
+fn textureStore_3a52ac() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3a52ac();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3a52ac();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3a52ac();
+}
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl
new file mode 100644
index 0000000..3ee4fd6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<r32float, write>;
+fn textureStore_3bb7a1() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3bb7a1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3bb7a1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3bb7a1();
+}
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl
new file mode 100644
index 0000000..a901a84
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_3bb7a1() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+void fragment_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+
+tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl
new file mode 100644
index 0000000..d4b0d0d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_3bb7a1() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_3bb7a1();
+ return;
+}
+
+
+tint_L0adSp.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a77606
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_3bb7a1 "textureStore_3bb7a1"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_3bb7a1 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_3bb7a1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_3bb7a1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_3bb7a1
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl
new file mode 100644
index 0000000..87ece03
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<r32float>;
+
+fn textureStore_3bb7a1() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3bb7a1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3bb7a1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3bb7a1();
+}
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl
new file mode 100644
index 0000000..aad435e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8uint, write>;
+fn textureStore_3bec15() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3bec15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3bec15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3bec15();
+}
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl
new file mode 100644
index 0000000..cfcedd9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_3bec15() {
+ arg_0[1] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_3bec15();
+ return;
+}
+
+void fragment_main() {
+ textureStore_3bec15();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_3bec15();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl
new file mode 100644
index 0000000..9a4bb45
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_3bec15() {
+ arg_0.write(uint4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_3bec15();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_3bec15();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_3bec15();
+ return;
+}
+
+
+tint_7THBtQ.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm
new file mode 100644
index 0000000..5a80a9d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_3bec15 "textureStore_3bec15"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %18 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_3bec15 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_3bec15
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_3bec15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_3bec15
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl
new file mode 100644
index 0000000..2cadcbe
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8uint>;
+
+fn textureStore_3bec15() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_3bec15();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_3bec15();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_3bec15();
+}
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl
new file mode 100644
index 0000000..5846c1c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32uint, write>;
+fn textureStore_441ba8() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_441ba8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_441ba8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_441ba8();
+}
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl
new file mode 100644
index 0000000..c980a0e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_441ba8() {
+ arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_441ba8();
+ return;
+}
+
+void fragment_main() {
+ textureStore_441ba8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_441ba8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl
new file mode 100644
index 0000000..6c5454b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_441ba8() {
+ arg_0.write(uint4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_441ba8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_441ba8();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_441ba8();
+ return;
+}
+
+
+tint_FcfuwY.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm
new file mode 100644
index 0000000..40cc744
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_441ba8 "textureStore_441ba8"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_441ba8 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_441ba8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_441ba8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_441ba8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl
new file mode 100644
index 0000000..ac7be08
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32uint>;
+
+fn textureStore_441ba8() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_441ba8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_441ba8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_441ba8();
+}
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl
new file mode 100644
index 0000000..cc41511
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+fn textureStore_4fc057() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_4fc057();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_4fc057();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_4fc057();
+}
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl
new file mode 100644
index 0000000..1316e26
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_4fc057() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_4fc057();
+ return;
+}
+
+void fragment_main() {
+ textureStore_4fc057();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_4fc057();
+ return;
+}
+
+
+tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl
new file mode 100644
index 0000000..e0e9cc6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_4fc057() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_4fc057();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_4fc057();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_4fc057();
+ return;
+}
+
+
+tint_xwVRdI.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm
new file mode 100644
index 0000000..9d0621b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_4fc057 "textureStore_4fc057"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_4fc057 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_4fc057
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_4fc057
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_4fc057
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl
new file mode 100644
index 0000000..1a909f8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8snorm>;
+
+fn textureStore_4fc057() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_4fc057();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_4fc057();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_4fc057();
+}
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl
new file mode 100644
index 0000000..063eecc
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16sint, write>;
+fn textureStore_5a2f8f() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_5a2f8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_5a2f8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_5a2f8f();
+}
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl
new file mode 100644
index 0000000..88412b5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureStore_5a2f8f() {
+ arg_0[1] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl
new file mode 100644
index 0000000..123767f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_5a2f8f() {
+ arg_0.write(int4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_5a2f8f();
+ return;
+}
+
+
+tint_iDp0i1.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..269e38c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_5a2f8f "textureStore_5a2f8f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %17 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_5a2f8f = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_5a2f8f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_5a2f8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_5a2f8f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..3053085
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16sint>;
+
+fn textureStore_5a2f8f() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_5a2f8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_5a2f8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_5a2f8f();
+}
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl
new file mode 100644
index 0000000..5500737
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+fn textureStore_60975f() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_60975f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_60975f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_60975f();
+}
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl
new file mode 100644
index 0000000..a3b60bb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_60975f() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_60975f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_60975f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_60975f();
+ return;
+}
+
+
+tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl
new file mode 100644
index 0000000..0b6f3e6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_60975f() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_60975f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_60975f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_60975f();
+ return;
+}
+
+
+tint_K8XxnZ.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a5c361
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_60975f "textureStore_60975f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_60975f = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_60975f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_60975f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_60975f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl
new file mode 100644
index 0000000..c7689fc
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8unorm>;
+
+fn textureStore_60975f() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_60975f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_60975f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_60975f();
+}
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl
new file mode 100644
index 0000000..ec1f1ae
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rg32uint, write>;
+fn textureStore_682fd6() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_682fd6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_682fd6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_682fd6();
+}
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl
new file mode 100644
index 0000000..3a8b9d0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_682fd6() {
+ arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_682fd6();
+ return;
+}
+
+void fragment_main() {
+ textureStore_682fd6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_682fd6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl
new file mode 100644
index 0000000..85a3f53
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_682fd6() {
+ arg_0.write(uint4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_682fd6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_682fd6();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_682fd6();
+ return;
+}
+
+
+tint_7adx7Y.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm
new file mode 100644
index 0000000..646031d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_682fd6 "textureStore_682fd6"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_682fd6 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_682fd6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_682fd6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_682fd6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl
new file mode 100644
index 0000000..0bfa046
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rg32uint>;
+
+fn textureStore_682fd6() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_682fd6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_682fd6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_682fd6();
+}
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl
new file mode 100644
index 0000000..187bba1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32float, write>;
+fn textureStore_6b75c3() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6b75c3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6b75c3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6b75c3();
+}
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl
new file mode 100644
index 0000000..677e584
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_6b75c3() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_6b75c3();
+ return;
+}
+
+void fragment_main() {
+ textureStore_6b75c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6b75c3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl
new file mode 100644
index 0000000..a1e8587
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6b75c3() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_6b75c3();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_6b75c3();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_6b75c3();
+ return;
+}
+
+
+tint_0jiMIP.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm
new file mode 100644
index 0000000..51ee16a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6b75c3 "textureStore_6b75c3"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_6b75c3 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_6b75c3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_6b75c3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_6b75c3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl
new file mode 100644
index 0000000..54e64b0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32float>;
+
+fn textureStore_6b75c3() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6b75c3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6b75c3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6b75c3();
+}
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl
new file mode 100644
index 0000000..cfded42
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<r32sint, write>;
+fn textureStore_6b80d2() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6b80d2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6b80d2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6b80d2();
+}
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl
new file mode 100644
index 0000000..eac402e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureStore_6b80d2() {
+ arg_0[1] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_6b80d2();
+ return;
+}
+
+void fragment_main() {
+ textureStore_6b80d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6b80d2();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl
new file mode 100644
index 0000000..5db01bc
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6b80d2() {
+ arg_0.write(int4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_6b80d2();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_6b80d2();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_6b80d2();
+ return;
+}
+
+
+tint_GXJj7s.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm
new file mode 100644
index 0000000..2ec370c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6b80d2 "textureStore_6b80d2"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %17 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_6b80d2 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_6b80d2
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_6b80d2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_6b80d2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl
new file mode 100644
index 0000000..6ab7b61
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<r32sint>;
+
+fn textureStore_6b80d2() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6b80d2();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6b80d2();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6b80d2();
+}
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl
new file mode 100644
index 0000000..987f5fe
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32uint, write>;
+fn textureStore_6cff2e() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6cff2e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6cff2e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6cff2e();
+}
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl
new file mode 100644
index 0000000..e149a2a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_6cff2e() {
+ arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_6cff2e();
+ return;
+}
+
+void fragment_main() {
+ textureStore_6cff2e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6cff2e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl
new file mode 100644
index 0000000..e1bd31a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6cff2e() {
+ arg_0.write(uint4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_6cff2e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_6cff2e();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_6cff2e();
+ return;
+}
+
+
+tint_UZX5yc.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm
new file mode 100644
index 0000000..83a83e7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6cff2e "textureStore_6cff2e"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_6cff2e = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_6cff2e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_6cff2e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_6cff2e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl
new file mode 100644
index 0000000..85ea47f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32uint>;
+
+fn textureStore_6cff2e() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6cff2e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6cff2e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6cff2e();
+}
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl
new file mode 100644
index 0000000..e811e01
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba16uint, write>;
+fn textureStore_6da692() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6da692();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6da692();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6da692();
+}
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl
new file mode 100644
index 0000000..ddf5d6f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_6da692() {
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_6da692();
+ return;
+}
+
+void fragment_main() {
+ textureStore_6da692();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6da692();
+ return;
+}
+
+
+tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl
new file mode 100644
index 0000000..69ef6cc
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6da692() {
+ arg_0.write(uint4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_6da692();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_6da692();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_6da692();
+ return;
+}
+
+
+tint_efhqMi.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c7fc02
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6da692 "textureStore_6da692"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+ %v4uint = OpTypeVector %uint 4
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_6da692 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %18 %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureStore_6da692
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_6da692
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_6da692
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl
new file mode 100644
index 0000000..da17065
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba16uint>;
+
+fn textureStore_6da692() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_6da692();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_6da692();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_6da692();
+}
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl
new file mode 100644
index 0000000..ad47ce9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/731349.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8unorm, write>;
+fn textureStore_731349() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_731349();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_731349();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_731349();
+}
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl
new file mode 100644
index 0000000..c6530ca
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_731349() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_731349();
+ return;
+}
+
+void fragment_main() {
+ textureStore_731349();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_731349();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl
new file mode 100644
index 0000000..7fb9168
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_731349() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_731349();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_731349();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_731349();
+ return;
+}
+
+
+tint_3Zm8LE.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm
new file mode 100644
index 0000000..577af62
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_731349 "textureStore_731349"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_731349 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_731349
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_731349
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_731349
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl
new file mode 100644
index 0000000..5b527d8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
+
+fn textureStore_731349() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_731349();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_731349();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_731349();
+}
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl
new file mode 100644
index 0000000..4424bb3
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba32sint, write>;
+fn textureStore_752da6() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_752da6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_752da6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_752da6();
+}
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl
new file mode 100644
index 0000000..60c15a1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureStore_752da6() {
+ arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_752da6();
+ return;
+}
+
+void fragment_main() {
+ textureStore_752da6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_752da6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl
new file mode 100644
index 0000000..4199b3f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_752da6() {
+ arg_0.write(int4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_752da6();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_752da6();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_752da6();
+ return;
+}
+
+
+tint_zgq0Dl.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm
new file mode 100644
index 0000000..4219376
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_752da6 "textureStore_752da6"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_752da6 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_752da6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_752da6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_752da6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl
new file mode 100644
index 0000000..2348d36
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba32sint>;
+
+fn textureStore_752da6() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_752da6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_752da6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_752da6();
+}
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl
new file mode 100644
index 0000000..bce5f33
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8uint, write>;
+fn textureStore_77c0ae() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_77c0ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_77c0ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_77c0ae();
+}
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl
new file mode 100644
index 0000000..9705f28
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_77c0ae() {
+ arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_77c0ae();
+ return;
+}
+
+void fragment_main() {
+ textureStore_77c0ae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_77c0ae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl
new file mode 100644
index 0000000..dcc371e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_77c0ae() {
+ arg_0.write(uint4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_77c0ae();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_77c0ae();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_77c0ae();
+ return;
+}
+
+
+tint_zmPi8W.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm
new file mode 100644
index 0000000..7434c65
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_77c0ae "textureStore_77c0ae"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %17 = OpConstantNull %v2int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_77c0ae = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_77c0ae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_77c0ae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_77c0ae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl
new file mode 100644
index 0000000..8ff941a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8uint>;
+
+fn textureStore_77c0ae() {
+ textureStore(arg_0, vec2<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_77c0ae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_77c0ae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_77c0ae();
+}
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl
new file mode 100644
index 0000000..7bf0a3b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32sint, write>;
+fn textureStore_7cec8d() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_7cec8d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_7cec8d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_7cec8d();
+}
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl
new file mode 100644
index 0000000..5fb0ec2
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_7cec8d() {
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+void fragment_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+
+tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl
new file mode 100644
index 0000000..1acbb04
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_7cec8d() {
+ arg_0.write(int4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_7cec8d();
+ return;
+}
+
+
+tint_YM1K5G.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm
new file mode 100644
index 0000000..9abd3e4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_7cec8d "textureStore_7cec8d"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4int = OpTypeVector %int 4
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_7cec8d = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_7cec8d
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_7cec8d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_7cec8d
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl
new file mode 100644
index 0000000..3ba2f7f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32sint>;
+
+fn textureStore_7cec8d() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_7cec8d();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_7cec8d();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_7cec8d();
+}
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl
new file mode 100644
index 0000000..203a4a5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8unorm, write>;
+fn textureStore_7f7fae() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_7f7fae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_7f7fae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_7f7fae();
+}
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl
new file mode 100644
index 0000000..0242359
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_7f7fae() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_7f7fae();
+ return;
+}
+
+void fragment_main() {
+ textureStore_7f7fae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_7f7fae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl
new file mode 100644
index 0000000..9fb1788
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_7f7fae() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_7f7fae();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_7f7fae();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_7f7fae();
+ return;
+}
+
+
+tint_l2ha2e.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm
new file mode 100644
index 0000000..6adb368
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_7f7fae "textureStore_7f7fae"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_7f7fae = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_7f7fae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_7f7fae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_7f7fae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl
new file mode 100644
index 0000000..e8ec3ee
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8unorm>;
+
+fn textureStore_7f7fae() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_7f7fae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_7f7fae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_7f7fae();
+}
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl
new file mode 100644
index 0000000..a27738f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/804942.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<r32sint, write>;
+fn textureStore_804942() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_804942();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_804942();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_804942();
+}
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl
new file mode 100644
index 0000000..226ade1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureStore_804942() {
+ arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_804942();
+ return;
+}
+
+void fragment_main() {
+ textureStore_804942();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_804942();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl
new file mode 100644
index 0000000..691a370
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_804942() {
+ arg_0.write(int4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_804942();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_804942();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_804942();
+ return;
+}
+
+
+tint_bnGq7U.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm
new file mode 100644
index 0000000..2a1b747
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_804942 "textureStore_804942"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_804942 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_804942
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_804942
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_804942
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl
new file mode 100644
index 0000000..ed39788
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<r32sint>;
+
+fn textureStore_804942() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_804942();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_804942();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_804942();
+}
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl
new file mode 100644
index 0000000..427a6a2
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8snorm, write>;
+fn textureStore_805dae() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_805dae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_805dae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_805dae();
+}
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl
new file mode 100644
index 0000000..1556ee1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_805dae() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_805dae();
+ return;
+}
+
+void fragment_main() {
+ textureStore_805dae();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_805dae();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl
new file mode 100644
index 0000000..2351b98
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_805dae() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_805dae();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_805dae();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_805dae();
+ return;
+}
+
+
+tint_5ZPxWj.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm
new file mode 100644
index 0000000..bdb0957
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_805dae "textureStore_805dae"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_805dae = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_805dae
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_805dae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_805dae
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl
new file mode 100644
index 0000000..8fd5751
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8snorm>;
+
+fn textureStore_805dae() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_805dae();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_805dae();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_805dae();
+}
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl
new file mode 100644
index 0000000..c951df7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32uint, write>;
+fn textureStore_83bcc1() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_83bcc1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_83bcc1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_83bcc1();
+}
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl
new file mode 100644
index 0000000..c03732f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_83bcc1() {
+ arg_0[1] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_83bcc1();
+ return;
+}
+
+void fragment_main() {
+ textureStore_83bcc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_83bcc1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl
new file mode 100644
index 0000000..7199f26
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_83bcc1() {
+ arg_0.write(uint4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_83bcc1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_83bcc1();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_83bcc1();
+ return;
+}
+
+
+tint_ZAiGAn.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..ddd4726
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_83bcc1 "textureStore_83bcc1"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %18 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_83bcc1 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_83bcc1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_83bcc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_83bcc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a2ee41
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32uint>;
+
+fn textureStore_83bcc1() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_83bcc1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_83bcc1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_83bcc1();
+}
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl
new file mode 100644
index 0000000..f379316
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/872747.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32float, write>;
+fn textureStore_872747() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_872747();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_872747();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_872747();
+}
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl
new file mode 100644
index 0000000..26076b1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_872747() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_872747();
+ return;
+}
+
+void fragment_main() {
+ textureStore_872747();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_872747();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl
new file mode 100644
index 0000000..eef8b46
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_872747() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_872747();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_872747();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_872747();
+ return;
+}
+
+
+tint_AifgyA.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm
new file mode 100644
index 0000000..1a704f6
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_872747 "textureStore_872747"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_872747 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_872747
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_872747
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_872747
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl
new file mode 100644
index 0000000..ff7a941
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32float>;
+
+fn textureStore_872747() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_872747();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_872747();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_872747();
+}
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl
new file mode 100644
index 0000000..9420a69
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32uint, write>;
+fn textureStore_8e0479() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_8e0479();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_8e0479();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_8e0479();
+}
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl
new file mode 100644
index 0000000..6abe930
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_8e0479() {
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_8e0479();
+ return;
+}
+
+void fragment_main() {
+ textureStore_8e0479();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8e0479();
+ return;
+}
+
+
+tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl
new file mode 100644
index 0000000..9b8b6ce
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_8e0479() {
+ arg_0.write(uint4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_8e0479();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_8e0479();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_8e0479();
+ return;
+}
+
+
+tint_scQig0.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm
new file mode 100644
index 0000000..8703aad
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_8e0479 "textureStore_8e0479"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+ %v4uint = OpTypeVector %uint 4
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_8e0479 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %18 %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureStore_8e0479
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_8e0479
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_8e0479
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl
new file mode 100644
index 0000000..5dcee17
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32uint>;
+
+fn textureStore_8e0479() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_8e0479();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_8e0479();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_8e0479();
+}
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl
new file mode 100644
index 0000000..268f13b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16sint, write>;
+fn textureStore_8f71a1() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_8f71a1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_8f71a1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_8f71a1();
+}
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl
new file mode 100644
index 0000000..1a241c9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureStore_8f71a1() {
+ arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_8f71a1();
+ return;
+}
+
+void fragment_main() {
+ textureStore_8f71a1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8f71a1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl
new file mode 100644
index 0000000..55376ea
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_8f71a1() {
+ arg_0.write(int4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_8f71a1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_8f71a1();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_8f71a1();
+ return;
+}
+
+
+tint_GBFPAJ.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1cf5015
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_8f71a1 "textureStore_8f71a1"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_8f71a1 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_8f71a1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_8f71a1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_8f71a1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f64e85
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16sint>;
+
+fn textureStore_8f71a1() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_8f71a1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_8f71a1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_8f71a1();
+}
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl
new file mode 100644
index 0000000..f80fdf4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/969534.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32sint, write>;
+fn textureStore_969534() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_969534();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_969534();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_969534();
+}
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl
new file mode 100644
index 0000000..974bcd9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureStore_969534() {
+ arg_0[1] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_969534();
+ return;
+}
+
+void fragment_main() {
+ textureStore_969534();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_969534();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl
new file mode 100644
index 0000000..3f41d77
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_969534() {
+ arg_0.write(int4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_969534();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_969534();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_969534();
+ return;
+}
+
+
+tint_9ZMPd8.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm
new file mode 100644
index 0000000..0d2b25b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_969534 "textureStore_969534"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %17 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_969534 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_969534
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_969534
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_969534
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl
new file mode 100644
index 0000000..53e571f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32sint>;
+
+fn textureStore_969534() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_969534();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_969534();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_969534();
+}
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl
new file mode 100644
index 0000000..3ba13a4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba32sint, write>;
+fn textureStore_9a3ecc() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9a3ecc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9a3ecc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9a3ecc();
+}
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl
new file mode 100644
index 0000000..7252b71
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureStore_9a3ecc() {
+ arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
+void fragment_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl
new file mode 100644
index 0000000..9275ac3
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9a3ecc() {
+ arg_0.write(int4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_9a3ecc();
+ return;
+}
+
+
+tint_WyUTaF.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm
new file mode 100644
index 0000000..16257e8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9a3ecc "textureStore_9a3ecc"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_9a3ecc = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_9a3ecc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_9a3ecc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_9a3ecc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl
new file mode 100644
index 0000000..727c546
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba32sint>;
+
+fn textureStore_9a3ecc() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9a3ecc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9a3ecc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9a3ecc();
+}
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl
new file mode 100644
index 0000000..4f2a3f3
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba32float, write>;
+fn textureStore_9d9cd5() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9d9cd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9d9cd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9d9cd5();
+}
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl
new file mode 100644
index 0000000..425d016
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_9d9cd5() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+void fragment_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+
+tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl
new file mode 100644
index 0000000..7c96ca7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9d9cd5() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_9d9cd5();
+ return;
+}
+
+
+tint_7LP9Um.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm
new file mode 100644
index 0000000..43f07cb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9d9cd5 "textureStore_9d9cd5"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_9d9cd5 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_9d9cd5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_9d9cd5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_9d9cd5
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl
new file mode 100644
index 0000000..6152a0c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba32float>;
+
+fn textureStore_9d9cd5() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9d9cd5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9d9cd5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9d9cd5();
+}
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl
new file mode 100644
index 0000000..4e4d687
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16sint, write>;
+fn textureStore_9e3ec5() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9e3ec5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9e3ec5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9e3ec5();
+}
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl
new file mode 100644
index 0000000..99edc0a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureStore_9e3ec5() {
+ arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
+void fragment_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl
new file mode 100644
index 0000000..eef2b2f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9e3ec5() {
+ arg_0.write(int4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_9e3ec5();
+ return;
+}
+
+
+tint_X1Wg39.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9595b1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9e3ec5 "textureStore_9e3ec5"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_9e3ec5 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_9e3ec5
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_9e3ec5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_9e3ec5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl
new file mode 100644
index 0000000..c098780
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16sint>;
+
+fn textureStore_9e3ec5() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_9e3ec5();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_9e3ec5();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_9e3ec5();
+}
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl
new file mode 100644
index 0000000..e0a32bd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32uint, write>;
+fn textureStore_ac67aa() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ac67aa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ac67aa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ac67aa();
+}
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl
new file mode 100644
index 0000000..f888070
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_ac67aa() {
+ arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_ac67aa();
+ return;
+}
+
+void fragment_main() {
+ textureStore_ac67aa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ac67aa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl
new file mode 100644
index 0000000..bd81135
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ac67aa() {
+ arg_0.write(uint4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_ac67aa();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_ac67aa();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_ac67aa();
+ return;
+}
+
+
+tint_uE9lGE.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm
new file mode 100644
index 0000000..9df59a8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm
@@ -0,0 +1,61 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ac67aa "textureStore_ac67aa"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_ac67aa = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_ac67aa
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_ac67aa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_ac67aa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl
new file mode 100644
index 0000000..ebf8cc5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32uint>;
+
+fn textureStore_ac67aa() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ac67aa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ac67aa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ac67aa();
+}
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl
new file mode 100644
index 0000000..59b894f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8sint, write>;
+fn textureStore_b706b1() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_b706b1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_b706b1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_b706b1();
+}
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl
new file mode 100644
index 0000000..6c9a134
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureStore_b706b1() {
+ arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_b706b1();
+ return;
+}
+
+void fragment_main() {
+ textureStore_b706b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_b706b1();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl
new file mode 100644
index 0000000..fb1410d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_b706b1() {
+ arg_0.write(int4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_b706b1();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_b706b1();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_b706b1();
+ return;
+}
+
+
+tint_3D3Uvl.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..b46f7cb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_b706b1 "textureStore_b706b1"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_b706b1 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_b706b1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_b706b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_b706b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..6f717da
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8sint>;
+
+fn textureStore_b706b1() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_b706b1();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_b706b1();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_b706b1();
+}
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl
new file mode 100644
index 0000000..e7b41fb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba8sint, write>;
+fn textureStore_bbcb7f() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_bbcb7f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_bbcb7f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_bbcb7f();
+}
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl
new file mode 100644
index 0000000..df0868c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureStore_bbcb7f() {
+ arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl
new file mode 100644
index 0000000..b3d7d99
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_bbcb7f() {
+ arg_0.write(int4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_bbcb7f();
+ return;
+}
+
+
+tint_GQyBB7.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm
new file mode 100644
index 0000000..56000e5
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_bbcb7f "textureStore_bbcb7f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_bbcb7f = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_bbcb7f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_bbcb7f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_bbcb7f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl
new file mode 100644
index 0000000..af697b0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba8sint>;
+
+fn textureStore_bbcb7f() {
+ textureStore(arg_0, vec2<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_bbcb7f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_bbcb7f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_bbcb7f();
+}
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl
new file mode 100644
index 0000000..6e1aeb9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d<rgba16float, write>;
+fn textureStore_be6e30() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_be6e30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_be6e30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_be6e30();
+}
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl
new file mode 100644
index 0000000..4918e06
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_be6e30() {
+ arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_be6e30();
+ return;
+}
+
+void fragment_main() {
+ textureStore_be6e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_be6e30();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl
new file mode 100644
index 0000000..d93712f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_be6e30() {
+ arg_0.write(float4(), int2());
+}
+
+vertex void vertex_main() {
+ textureStore_be6e30();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_be6e30();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_be6e30();
+ return;
+}
+
+
+tint_FLv41D.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm
new file mode 100644
index 0000000..ecf44b0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_be6e30 "textureStore_be6e30"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %16 = OpConstantNull %v2int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_be6e30 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_be6e30
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_be6e30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_be6e30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl
new file mode 100644
index 0000000..1bd8d78
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d<rgba16float>;
+
+fn textureStore_be6e30() {
+ textureStore(arg_0, vec2<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_be6e30();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_be6e30();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_be6e30();
+}
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl
new file mode 100644
index 0000000..62c7939
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba8sint, write>;
+fn textureStore_bf775c() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_bf775c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_bf775c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_bf775c();
+}
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl
new file mode 100644
index 0000000..09c1673
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureStore_bf775c() {
+ arg_0[1] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_bf775c();
+ return;
+}
+
+void fragment_main() {
+ textureStore_bf775c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_bf775c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl
new file mode 100644
index 0000000..4037b9b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_bf775c() {
+ arg_0.write(int4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_bf775c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_bf775c();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_bf775c();
+ return;
+}
+
+
+tint_41mJPt.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm
new file mode 100644
index 0000000..8c196e4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_bf775c "textureStore_bf775c"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %17 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_bf775c = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_bf775c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_bf775c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_bf775c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl
new file mode 100644
index 0000000..cc479d1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba8sint>;
+
+fn textureStore_bf775c() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_bf775c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_bf775c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_bf775c();
+}
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl
new file mode 100644
index 0000000..3cb1ba0
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba16float, write>;
+fn textureStore_c5af1e() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_c5af1e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_c5af1e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_c5af1e();
+}
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl
new file mode 100644
index 0000000..fb29261
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_c5af1e() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_c5af1e();
+ return;
+}
+
+void fragment_main() {
+ textureStore_c5af1e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_c5af1e();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl
new file mode 100644
index 0000000..f5bf9ce
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_c5af1e() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_c5af1e();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_c5af1e();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_c5af1e();
+ return;
+}
+
+
+tint_agFxJI.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm
new file mode 100644
index 0000000..fbd7f69
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_c5af1e "textureStore_c5af1e"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_c5af1e = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_c5af1e
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_c5af1e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_c5af1e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl
new file mode 100644
index 0000000..b973b75
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba16float>;
+
+fn textureStore_c5af1e() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_c5af1e();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_c5af1e();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_c5af1e();
+}
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl
new file mode 100644
index 0000000..e4607bb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32float, write>;
+fn textureStore_c863be() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_c863be();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_c863be();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_c863be();
+}
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl
new file mode 100644
index 0000000..172a759
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_c863be() {
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_c863be();
+ return;
+}
+
+void fragment_main() {
+ textureStore_c863be();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_c863be();
+ return;
+}
+
+
+tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
+
+tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl
new file mode 100644
index 0000000..5c6fb3a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_c863be() {
+ arg_0.write(float4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_c863be();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_c863be();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_c863be();
+ return;
+}
+
+
+tint_GI47uE.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm
new file mode 100644
index 0000000..765d58a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_c863be "textureStore_c863be"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4float = OpTypeVector %float 4
+ %19 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_c863be = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_c863be
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_c863be
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_c863be
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '14[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl
new file mode 100644
index 0000000..849df74
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32float>;
+
+fn textureStore_c863be() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_c863be();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_c863be();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_c863be();
+}
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl
new file mode 100644
index 0000000..a290200
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rg32sint, write>;
+fn textureStore_d73b5c() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_d73b5c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_d73b5c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_d73b5c();
+}
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl
new file mode 100644
index 0000000..a550f78
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureStore_d73b5c() {
+ arg_0[1] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_d73b5c();
+ return;
+}
+
+void fragment_main() {
+ textureStore_d73b5c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_d73b5c();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl
new file mode 100644
index 0000000..d62d408
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_d73b5c() {
+ arg_0.write(int4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_d73b5c();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_d73b5c();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_d73b5c();
+ return;
+}
+
+
+tint_PXkRSh.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm
new file mode 100644
index 0000000..9bd7a5c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_d73b5c "textureStore_d73b5c"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+ %v4int = OpTypeVector %int 4
+ %17 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_d73b5c = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_d73b5c
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_d73b5c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_d73b5c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl
new file mode 100644
index 0000000..1966313
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rg32sint>;
+
+fn textureStore_d73b5c() {
+ textureStore(arg_0, 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_d73b5c();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_d73b5c();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_d73b5c();
+}
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl
new file mode 100644
index 0000000..e4ee1e4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8snorm, write>;
+fn textureStore_dd7d81() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_dd7d81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_dd7d81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_dd7d81();
+}
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl
new file mode 100644
index 0000000..b47a495
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_dd7d81() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_dd7d81();
+ return;
+}
+
+void fragment_main() {
+ textureStore_dd7d81();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dd7d81();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl
new file mode 100644
index 0000000..935b0c7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_dd7d81() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_dd7d81();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_dd7d81();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_dd7d81();
+ return;
+}
+
+
+tint_liWDoV.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm
new file mode 100644
index 0000000..c3658e7
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_dd7d81 "textureStore_dd7d81"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_dd7d81 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_dd7d81
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_dd7d81
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_dd7d81
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl
new file mode 100644
index 0000000..7f448d4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8snorm>;
+
+fn textureStore_dd7d81() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_dd7d81();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_dd7d81();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_dd7d81();
+}
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl
new file mode 100644
index 0000000..39d1eda
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32uint, write>;
+fn textureStore_dde364() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_dde364();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_dde364();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_dde364();
+}
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl
new file mode 100644
index 0000000..37c71f3
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureStore_dde364() {
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_dde364();
+ return;
+}
+
+void fragment_main() {
+ textureStore_dde364();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_dde364();
+ return;
+}
+
+
+tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
+
+tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl
new file mode 100644
index 0000000..0592dba
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_dde364() {
+ arg_0.write(uint4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_dde364();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_dde364();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_dde364();
+ return;
+}
+
+
+tint_uY3wST.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm
new file mode 100644
index 0000000..6e0667f
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm
@@ -0,0 +1,70 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_dde364 "textureStore_dde364"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %18 = OpConstantComposite %v3int %int_1
+ %v4uint = OpTypeVector %uint 4
+ %20 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_dde364 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %18 %20
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %textureStore_dde364
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_dde364
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureStore_dde364
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %18 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl
new file mode 100644
index 0000000..d03b488
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32uint>;
+
+fn textureStore_dde364() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_dde364();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_dde364();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_dde364();
+}
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl
new file mode 100644
index 0000000..013bd3a
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba16float, write>;
+fn textureStore_e885e8() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_e885e8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_e885e8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_e885e8();
+}
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl
new file mode 100644
index 0000000..110b1fd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_e885e8() {
+ arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_e885e8();
+ return;
+}
+
+void fragment_main() {
+ textureStore_e885e8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_e885e8();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl
new file mode 100644
index 0000000..deb4e3e
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_e885e8() {
+ arg_0.write(float4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_e885e8();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_e885e8();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_e885e8();
+ return;
+}
+
+
+tint_EfGtQR.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm
new file mode 100644
index 0000000..0f1837d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 28
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_e885e8 "textureStore_e885e8"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4float = OpTypeVector %float 4
+ %17 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_e885e8 = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %int_1 %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %19 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %21 = OpFunctionCall %void %textureStore_e885e8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %textureStore_e885e8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_e885e8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl
new file mode 100644
index 0000000..e4feafb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba16float>;
+
+fn textureStore_e885e8() {
+ textureStore(arg_0, 1, vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_e885e8();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_e885e8();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_e885e8();
+}
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl
new file mode 100644
index 0000000..040b104
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32float, write>;
+fn textureStore_eb702f() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_eb702f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_eb702f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_eb702f();
+}
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl
new file mode 100644
index 0000000..f2f1217
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_eb702f() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_eb702f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_eb702f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_eb702f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl
new file mode 100644
index 0000000..eec733b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_eb702f() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_eb702f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_eb702f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_eb702f();
+ return;
+}
+
+
+tint_mkqzHD.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm
new file mode 100644
index 0000000..805163c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_eb702f "textureStore_eb702f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_eb702f = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_eb702f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_eb702f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_eb702f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl
new file mode 100644
index 0000000..de86b76
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32float>;
+
+fn textureStore_eb702f() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_eb702f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_eb702f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_eb702f();
+}
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl
new file mode 100644
index 0000000..4aa2004
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32sint, write>;
+fn textureStore_eb78b9() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_eb78b9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_eb78b9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_eb78b9();
+}
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl
new file mode 100644
index 0000000..8a2ccfd
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureStore_eb78b9() {
+ arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_eb78b9();
+ return;
+}
+
+void fragment_main() {
+ textureStore_eb78b9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_eb78b9();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl
new file mode 100644
index 0000000..f989309
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_eb78b9() {
+ arg_0.write(int4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_eb78b9();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_eb78b9();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_eb78b9();
+ return;
+}
+
+
+tint_Vp5fbQ.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm
new file mode 100644
index 0000000..2ff5b98
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm
@@ -0,0 +1,59 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_eb78b9 "textureStore_eb78b9"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4int = OpTypeVector %int 4
+ %18 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_eb78b9 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_eb78b9
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_eb78b9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_eb78b9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb76666
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32sint>;
+
+fn textureStore_eb78b9() {
+ textureStore(arg_0, vec3<i32>(), vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_eb78b9();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_eb78b9();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_eb78b9();
+}
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl
new file mode 100644
index 0000000..a1a7801
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rg32float, write>;
+fn textureStore_ee6acc() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ee6acc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ee6acc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ee6acc();
+}
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl
new file mode 100644
index 0000000..a321851
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_ee6acc() {
+ arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void vertex_main() {
+ textureStore_ee6acc();
+ return;
+}
+
+void fragment_main() {
+ textureStore_ee6acc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ee6acc();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl
new file mode 100644
index 0000000..9ba323d
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ee6acc() {
+ arg_0.write(float4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_ee6acc();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_ee6acc();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_ee6acc();
+ return;
+}
+
+
+tint_Cu9b6y.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(float4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm
new file mode 100644
index 0000000..f11aa5c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ee6acc "textureStore_ee6acc"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %8 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %16 = OpConstantNull %v3int
+ %v4float = OpTypeVector %float 4
+ %18 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%textureStore_ee6acc = OpFunction %void None %8
+ %11 = OpLabel
+ %13 = OpLoad %7 %arg_0
+ OpImageWrite %13 %16 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %8
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_ee6acc
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %8
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_ee6acc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %8
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_ee6acc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl
new file mode 100644
index 0000000..3530be4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rg32float>;
+
+fn textureStore_ee6acc() {
+ textureStore(arg_0, vec3<i32>(), vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ee6acc();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ee6acc();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ee6acc();
+}
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl
new file mode 100644
index 0000000..541ee39
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<r32uint, write>;
+fn textureStore_ef9f2f() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ef9f2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ef9f2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ef9f2f();
+}
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl
new file mode 100644
index 0000000..18e4e26
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_ef9f2f() {
+ arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl
new file mode 100644
index 0000000..73d6331
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ef9f2f() {
+ arg_0.write(uint4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_ef9f2f();
+ return;
+}
+
+
+tint_BKGK1I.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm
new file mode 100644
index 0000000..3d68722
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ef9f2f "textureStore_ef9f2f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_ef9f2f = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_ef9f2f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_ef9f2f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_ef9f2f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl
new file mode 100644
index 0000000..f2f20c1
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<r32uint>;
+
+fn textureStore_ef9f2f() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_ef9f2f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_ef9f2f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_ef9f2f();
+}
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl
new file mode 100644
index 0000000..dd8a4fb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_3d<rgba8uint, write>;
+fn textureStore_f8dead() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_f8dead();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_f8dead();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_f8dead();
+}
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl
new file mode 100644
index 0000000..e6687d3
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_f8dead() {
+ arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_f8dead();
+ return;
+}
+
+void fragment_main() {
+ textureStore_f8dead();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f8dead();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl
new file mode 100644
index 0000000..fb37bc8
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_f8dead() {
+ arg_0.write(uint4(), int3());
+}
+
+vertex void vertex_main() {
+ textureStore_f8dead();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_f8dead();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_f8dead();
+ return;
+}
+
+
+tint_Agnpo0.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), int3());
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm
new file mode 100644
index 0000000..f421043
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_f8dead "textureStore_f8dead"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %17 = OpConstantNull %v3int
+ %v4uint = OpTypeVector %uint 4
+ %19 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_f8dead = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_f8dead
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_f8dead
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_f8dead
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl
new file mode 100644
index 0000000..184af58
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d<rgba8uint>;
+
+fn textureStore_f8dead() {
+ textureStore(arg_0, vec3<i32>(), vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_f8dead();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_f8dead();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_f8dead();
+}
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl
new file mode 100644
index 0000000..07e21f9
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rg32sint, write>;
+fn textureStore_f9be83() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_f9be83();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_f9be83();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_f9be83();
+}
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl
new file mode 100644
index 0000000..5314d71
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_f9be83() {
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_f9be83();
+ return;
+}
+
+void fragment_main() {
+ textureStore_f9be83();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f9be83();
+ return;
+}
+
+
+tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl
new file mode 100644
index 0000000..9846915
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_f9be83() {
+ arg_0.write(int4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_f9be83();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_f9be83();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_f9be83();
+ return;
+}
+
+
+tint_EfgEDv.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm
new file mode 100644
index 0000000..9d3e7de
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm
@@ -0,0 +1,69 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_f9be83 "textureStore_f9be83"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4int = OpTypeVector %int 4
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_f9be83 = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_f9be83
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_f9be83
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_f9be83
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl
new file mode 100644
index 0000000..bdc6309
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rg32sint>;
+
+fn textureStore_f9be83() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_f9be83();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_f9be83();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_f9be83();
+}
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl
new file mode 100644
index 0000000..13a6929
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_1d<rgba32uint, write>;
+fn textureStore_fb9a8f() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_fb9a8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_fb9a8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_fb9a8f();
+}
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl
new file mode 100644
index 0000000..605ed73
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureStore_fb9a8f() {
+ arg_0[1] = uint4(0u, 0u, 0u, 0u);
+}
+
+void vertex_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl
new file mode 100644
index 0000000..7eede7b
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_fb9a8f() {
+ arg_0.write(uint4(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_fb9a8f();
+ return;
+}
+
+
+tint_qJBlCj.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(uint4(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..32c9ecb
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm
@@ -0,0 +1,60 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_fb9a8f "textureStore_fb9a8f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %uint = OpTypeInt 32 0
+ %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %v4uint = OpTypeVector %uint 4
+ %18 = OpConstantNull %v4uint
+ %float_1 = OpConstant %float 1
+%textureStore_fb9a8f = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %int_1 %18
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %20 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %22 = OpFunctionCall %void %textureStore_fb9a8f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_fb9a8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureStore_fb9a8f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..f22a569
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d<rgba32uint>;
+
+fn textureStore_fb9a8f() {
+ textureStore(arg_0, 1, vec4<u32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_fb9a8f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_fb9a8f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_fb9a8f();
+}
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl
new file mode 100644
index 0000000..eac93e4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl
@@ -0,0 +1,43 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+[[group(1), binding(0)]] var arg_0: texture_storage_2d_array<rgba8sint, write>;
+fn textureStore_fbf53f() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_fbf53f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_fbf53f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_fbf53f();
+}
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl
new file mode 100644
index 0000000..295677c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl
@@ -0,0 +1,42 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureStore_fbf53f() {
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+}
+
+void vertex_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+void fragment_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+
+tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
+
+tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1)
+ arg_0[int3(1)] = int4(0, 0, 0, 0);
+ ^
+
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl
new file mode 100644
index 0000000..ecabc8c
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl
@@ -0,0 +1,32 @@
+SKIP: FAILED
+
+
+
+Validation Failure:
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_fbf53f() {
+ arg_0.write(int4(), int2(), 1);
+}
+
+vertex void vertex_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+fragment void fragment_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+kernel void compute_main() {
+ textureStore_fbf53f();
+ return;
+}
+
+
+tint_bdJTN4.metal:5:3: error: use of undeclared identifier 'arg_0'
+ arg_0.write(int4(), int2(), 1);
+ ^
+1 error generated.
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb4f353
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm
@@ -0,0 +1,68 @@
+SKIP: FAILED
+
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_fbf53f "textureStore_fbf53f"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %int = OpTypeInt 32 1
+ %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
+ %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %17 = OpConstantComposite %v3int %int_1
+ %v4int = OpTypeVector %int 4
+ %19 = OpConstantNull %v4int
+ %float_1 = OpConstant %float 1
+%textureStore_fbf53f = OpFunction %void None %9
+ %12 = OpLabel
+ %14 = OpLoad %7 %arg_0
+ OpImageWrite %14 %17 %19
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %23 = OpFunctionCall %void %textureStore_fbf53f
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureStore_fbf53f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureStore_fbf53f
+ OpReturn
+ OpFunctionEnd
+
+
+Validation Failure:
+1:1: OpConstantComposite Constituent <id> count does not match Result Type <id> '15[%v3int]'s vector component count.
+ %17 = OpConstantComposite %v3int %int_1
+
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl
new file mode 100644
index 0000000..b19b0a4
--- /dev/null
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array<rgba8sint>;
+
+fn textureStore_fbf53f() {
+ textureStore(arg_0, vec2<i32>(), 1, vec4<i32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ textureStore_fbf53f();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ textureStore_fbf53f();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ textureStore_fbf53f();
+}
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl
new file mode 100644
index 0000000..3358cff
--- /dev/null
+++ b/test/intrinsics/gen/trunc/562d05.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn trunc_562d05() {
+ var res: vec3<f32> = trunc(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_562d05();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_562d05();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_562d05();
+}
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl
new file mode 100644
index 0000000..e1bad91
--- /dev/null
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void trunc_562d05() {
+ float3 res = trunc(float3(0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ trunc_562d05();
+ return;
+}
+
+void fragment_main() {
+ trunc_562d05();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ trunc_562d05();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl
new file mode 100644
index 0000000..5ed7816
--- /dev/null
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void trunc_562d05() {
+ float3 res = trunc(float3());
+}
+
+vertex void vertex_main() {
+ trunc_562d05();
+ return;
+}
+
+fragment void fragment_main() {
+ trunc_562d05();
+ return;
+}
+
+kernel void compute_main() {
+ trunc_562d05();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm
new file mode 100644
index 0000000..ed7d4b7
--- /dev/null
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %trunc_562d05 "trunc_562d05"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+ %12 = OpConstantNull %v3float
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %float_1 = OpConstant %float 1
+%trunc_562d05 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %12
+ %9 = OpExtInst %v3float %11 Trunc %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %trunc_562d05
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %trunc_562d05
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %trunc_562d05
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl
new file mode 100644
index 0000000..b1b6347
--- /dev/null
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn trunc_562d05() {
+ var res : vec3<f32> = trunc(vec3<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_562d05();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_562d05();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_562d05();
+}
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl
new file mode 100644
index 0000000..f52677e
--- /dev/null
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn trunc_e183aa() {
+ var res: vec4<f32> = trunc(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_e183aa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_e183aa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_e183aa();
+}
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl
new file mode 100644
index 0000000..8f55919
--- /dev/null
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void trunc_e183aa() {
+ float4 res = trunc(float4(0.0f, 0.0f, 0.0f, 0.0f));
+}
+
+void vertex_main() {
+ trunc_e183aa();
+ return;
+}
+
+void fragment_main() {
+ trunc_e183aa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ trunc_e183aa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl
new file mode 100644
index 0000000..7b48026
--- /dev/null
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void trunc_e183aa() {
+ float4 res = trunc(float4());
+}
+
+vertex void vertex_main() {
+ trunc_e183aa();
+ return;
+}
+
+fragment void fragment_main() {
+ trunc_e183aa();
+ return;
+}
+
+kernel void compute_main() {
+ trunc_e183aa();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm
new file mode 100644
index 0000000..01065e1
--- /dev/null
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %trunc_e183aa "trunc_e183aa"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %12 = OpConstantNull %v4float
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %float_1 = OpConstant %float 1
+%trunc_e183aa = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %12
+ %9 = OpExtInst %v4float %11 Trunc %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %trunc_e183aa
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %trunc_e183aa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %trunc_e183aa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl
new file mode 100644
index 0000000..f41ba24
--- /dev/null
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn trunc_e183aa() {
+ var res : vec4<f32> = trunc(vec4<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_e183aa();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_e183aa();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_e183aa();
+}
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl
new file mode 100644
index 0000000..3487eb3
--- /dev/null
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn trunc_eb83df() {
+ var res: f32 = trunc(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_eb83df();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_eb83df();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_eb83df();
+}
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl
new file mode 100644
index 0000000..0dc4fc4
--- /dev/null
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void trunc_eb83df() {
+ float res = trunc(1.0f);
+}
+
+void vertex_main() {
+ trunc_eb83df();
+ return;
+}
+
+void fragment_main() {
+ trunc_eb83df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ trunc_eb83df();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl
new file mode 100644
index 0000000..803fea7
--- /dev/null
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void trunc_eb83df() {
+ float res = trunc(1.0f);
+}
+
+vertex void vertex_main() {
+ trunc_eb83df();
+ return;
+}
+
+fragment void fragment_main() {
+ trunc_eb83df();
+ return;
+}
+
+kernel void compute_main() {
+ trunc_eb83df();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm
new file mode 100644
index 0000000..73577d1
--- /dev/null
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm
@@ -0,0 +1,51 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 23
+; Schema: 0
+ OpCapability Shader
+ %10 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %trunc_eb83df "trunc_eb83df"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %float_1 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+%trunc_eb83df = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %4
+ %9 = OpExtInst %float %10 Trunc %float_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %15 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %16 = OpFunctionCall %void %trunc_eb83df
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %trunc_eb83df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %trunc_eb83df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl
new file mode 100644
index 0000000..ebf5104
--- /dev/null
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn trunc_eb83df() {
+ var res : f32 = trunc(1.0);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_eb83df();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_eb83df();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_eb83df();
+}
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl
new file mode 100644
index 0000000..0a3c51a
--- /dev/null
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn trunc_f370d3() {
+ var res: vec2<f32> = trunc(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_f370d3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_f370d3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_f370d3();
+}
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl
new file mode 100644
index 0000000..92854e2
--- /dev/null
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl
@@ -0,0 +1,20 @@
+void trunc_f370d3() {
+ float2 res = trunc(float2(0.0f, 0.0f));
+}
+
+void vertex_main() {
+ trunc_f370d3();
+ return;
+}
+
+void fragment_main() {
+ trunc_f370d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ trunc_f370d3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl
new file mode 100644
index 0000000..b5ec5fd
--- /dev/null
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void trunc_f370d3() {
+ float2 res = trunc(float2());
+}
+
+vertex void vertex_main() {
+ trunc_f370d3();
+ return;
+}
+
+fragment void fragment_main() {
+ trunc_f370d3();
+ return;
+}
+
+kernel void compute_main() {
+ trunc_f370d3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm
new file mode 100644
index 0000000..6269144
--- /dev/null
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm
@@ -0,0 +1,53 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 25
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %trunc_f370d3 "trunc_f370d3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %12 = OpConstantNull %v2float
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %float_1 = OpConstant %float 1
+%trunc_f370d3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %12
+ %9 = OpExtInst %v2float %11 Trunc %12
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %16 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %18 = OpFunctionCall %void %trunc_f370d3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %trunc_f370d3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %23 = OpLabel
+ %24 = OpFunctionCall %void %trunc_f370d3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl
new file mode 100644
index 0000000..35a6565
--- /dev/null
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn trunc_f370d3() {
+ var res : vec2<f32> = trunc(vec2<f32>());
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ trunc_f370d3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ trunc_f370d3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ trunc_f370d3();
+}
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl
new file mode 100644
index 0000000..93e4b1f
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn unpack2x16float_32a5cf() {
+ var res: vec2<f32> = unpack2x16float(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16float_32a5cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16float_32a5cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16float_32a5cf();
+}
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl
new file mode 100644
index 0000000..e675e28
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl
@@ -0,0 +1,21 @@
+void unpack2x16float_32a5cf() {
+ uint tint_tmp = 1u;
+float2 res = f16tof32(uint2(tint_tmp & 0xffff, tint_tmp >> 16));
+}
+
+void vertex_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
+void fragment_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl
new file mode 100644
index 0000000..8f4f001
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void unpack2x16float_32a5cf() {
+ float2 res = float2(as_type<half2>(1u));
+}
+
+vertex void vertex_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
+fragment void fragment_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
+kernel void compute_main() {
+ unpack2x16float_32a5cf();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b608ba
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %16 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%unpack2x16float_32a5cf = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %9 = OpExtInst %v2float %11 UnpackHalf2x16 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %unpack2x16float_32a5cf
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %unpack2x16float_32a5cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %unpack2x16float_32a5cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..d310518
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn unpack2x16float_32a5cf() {
+ var res : vec2<f32> = unpack2x16float(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16float_32a5cf();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16float_32a5cf();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16float_32a5cf();
+}
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl
new file mode 100644
index 0000000..5488436
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn unpack2x16snorm_b4aea6() {
+ var res: vec2<f32> = unpack2x16snorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16snorm_b4aea6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16snorm_b4aea6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16snorm_b4aea6();
+}
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl
new file mode 100644
index 0000000..9a90dc9
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+void unpack2x16snorm_b4aea6() {
+ int tint_tmp_1 = int(1u);
+int2 tint_tmp = int2(tint_tmp_1 << 16, tint_tmp_1) >> 16;
+float2 res = clamp(float2(tint_tmp) / 32767.0, -1.0, 1.0);
+}
+
+void vertex_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
+void fragment_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl
new file mode 100644
index 0000000..c315dce
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void unpack2x16snorm_b4aea6() {
+ float2 res = unpack_snorm2x16_to_float(1u);
+}
+
+vertex void vertex_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
+fragment void fragment_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
+kernel void compute_main() {
+ unpack2x16snorm_b4aea6();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
new file mode 100644
index 0000000..c52f991
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %16 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%unpack2x16snorm_b4aea6 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %9 = OpExtInst %v2float %11 UnpackSnorm2x16 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
new file mode 100644
index 0000000..662770e
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn unpack2x16snorm_b4aea6() {
+ var res : vec2<f32> = unpack2x16snorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16snorm_b4aea6();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16snorm_b4aea6();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16snorm_b4aea6();
+}
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl
new file mode 100644
index 0000000..4b22886
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn unpack2x16unorm_7699c0() {
+ var res: vec2<f32> = unpack2x16unorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16unorm_7699c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16unorm_7699c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16unorm_7699c0();
+}
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl
new file mode 100644
index 0000000..cb6aef9
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+void unpack2x16unorm_7699c0() {
+ uint tint_tmp_1 = 1u;
+uint2 tint_tmp = uint2(tint_tmp_1 & 0xffff, tint_tmp_1 >> 16);
+float2 res = float2(tint_tmp) / 65535.0;
+}
+
+void vertex_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
+void fragment_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl
new file mode 100644
index 0000000..9d65266
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void unpack2x16unorm_7699c0() {
+ float2 res = unpack_unorm2x16_to_float(1u);
+}
+
+vertex void vertex_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
+fragment void fragment_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
+kernel void compute_main() {
+ unpack2x16unorm_7699c0();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..1df109e
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %16 = OpConstantNull %v2float
+ %float_1 = OpConstant %float 1
+%unpack2x16unorm_7699c0 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %9 = OpExtInst %v2float %11 UnpackUnorm2x16 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %unpack2x16unorm_7699c0
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %unpack2x16unorm_7699c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %unpack2x16unorm_7699c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..819996c
--- /dev/null
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn unpack2x16unorm_7699c0() {
+ var res : vec2<f32> = unpack2x16unorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack2x16unorm_7699c0();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack2x16unorm_7699c0();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack2x16unorm_7699c0();
+}
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl
new file mode 100644
index 0000000..9c70342
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn unpack4x8snorm_523fb3() {
+ var res: vec4<f32> = unpack4x8snorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack4x8snorm_523fb3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack4x8snorm_523fb3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack4x8snorm_523fb3();
+}
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl
new file mode 100644
index 0000000..e9009fc
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+void unpack4x8snorm_523fb3() {
+ int tint_tmp_1 = int(1u);
+int4 tint_tmp = int4(tint_tmp_1 << 24, tint_tmp_1 << 16, tint_tmp_1 << 8, tint_tmp_1) >> 24;
+float4 res = clamp(float4(tint_tmp) / 127.0, -1.0, 1.0);
+}
+
+void vertex_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
+void fragment_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl
new file mode 100644
index 0000000..1912c1a
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void unpack4x8snorm_523fb3() {
+ float4 res = unpack_snorm4x8_to_float(1u);
+}
+
+vertex void vertex_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
+fragment void fragment_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
+kernel void compute_main() {
+ unpack4x8snorm_523fb3();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm
new file mode 100644
index 0000000..3fc6309
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %16 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%unpack4x8snorm_523fb3 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %16
+ %9 = OpExtInst %v4float %11 UnpackSnorm4x8 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl
new file mode 100644
index 0000000..6352fdc
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn unpack4x8snorm_523fb3() {
+ var res : vec4<f32> = unpack4x8snorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack4x8snorm_523fb3();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack4x8snorm_523fb3();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack4x8snorm_523fb3();
+}
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl
new file mode 100644
index 0000000..6bab108
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl
@@ -0,0 +1,42 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn unpack4x8unorm_750c74() {
+ var res: vec4<f32> = unpack4x8unorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack4x8unorm_750c74();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack4x8unorm_750c74();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack4x8unorm_750c74();
+}
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl
new file mode 100644
index 0000000..bb43457
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl
@@ -0,0 +1,22 @@
+void unpack4x8unorm_750c74() {
+ uint tint_tmp_1 = 1u;
+uint4 tint_tmp = uint4(tint_tmp_1 & 0xff, (tint_tmp_1 >> 8) & 0xff, (tint_tmp_1 >> 16) & 0xff, tint_tmp_1 >> 24);
+float4 res = float4(tint_tmp) / 255.0;
+}
+
+void vertex_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
+void fragment_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl
new file mode 100644
index 0000000..9b8a802
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl
@@ -0,0 +1,22 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void unpack4x8unorm_750c74() {
+ float4 res = unpack_unorm4x8_to_float(1u);
+}
+
+vertex void vertex_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
+fragment void fragment_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
+kernel void compute_main() {
+ unpack4x8unorm_750c74();
+ return;
+}
+
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm
new file mode 100644
index 0000000..6b420e3
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm
@@ -0,0 +1,55 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 27
+; Schema: 0
+ OpCapability Shader
+ %11 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %tint_pointsize "tint_pointsize"
+ OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74"
+ OpName %res "res"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %tint_pointsize BuiltIn PointSize
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+ %4 = OpConstantNull %float
+%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %void = OpTypeVoid
+ %5 = OpTypeFunction %void
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %16 = OpConstantNull %v4float
+ %float_1 = OpConstant %float 1
+%unpack4x8unorm_750c74 = OpFunction %void None %5
+ %8 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %16
+ %9 = OpExtInst %v4float %11 UnpackUnorm4x8 %uint_1
+ OpStore %res %9
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %5
+ %18 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %20 = OpFunctionCall %void %unpack4x8unorm_750c74
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %5
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %unpack4x8unorm_750c74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %5
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %unpack4x8unorm_750c74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl
new file mode 100644
index 0000000..53e0972
--- /dev/null
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl
@@ -0,0 +1,18 @@
+fn unpack4x8unorm_750c74() {
+ var res : vec4<f32> = unpack4x8unorm(1u);
+}
+
+[[stage(vertex)]]
+fn vertex_main() {
+ unpack4x8unorm_750c74();
+}
+
+[[stage(fragment)]]
+fn fragment_main() {
+ unpack4x8unorm_750c74();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ unpack4x8unorm_750c74();
+}
diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl
new file mode 100644
index 0000000..287246c
--- /dev/null
+++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl
@@ -0,0 +1,32 @@
+// Copyright 2021 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/intrinsic-gen
+// using the template:
+// test/intrinsics/intrinsics.wgsl.tmpl
+// and the intrinsic defintion file:
+// src/intrinsics.def
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+fn workgroupBarrier_a17f7f() {
+ workgroupBarrier();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ workgroupBarrier_a17f7f();
+}
diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl
new file mode 100644
index 0000000..6d12710
--- /dev/null
+++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl
@@ -0,0 +1,10 @@
+void workgroupBarrier_a17f7f() {
+ GroupMemoryBarrierWithGroupSync();
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ workgroupBarrier_a17f7f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl
new file mode 100644
index 0000000..a3dcb47
--- /dev/null
+++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl
@@ -0,0 +1,12 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void workgroupBarrier_a17f7f() {
+ threadgroup_barrier(mem_flags::mem_threadgroup);
+}
+
+kernel void compute_main() {
+ workgroupBarrier_a17f7f();
+ return;
+}
+
diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm
new file mode 100644
index 0000000..dfea5e8
--- /dev/null
+++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm
@@ -0,0 +1,26 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 12
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %workgroupBarrier_a17f7f "workgroupBarrier_a17f7f"
+ OpName %compute_main "compute_main"
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %uint_264 = OpConstant %uint 264
+%workgroupBarrier_a17f7f = OpFunction %void None %1
+ %4 = OpLabel
+ OpControlBarrier %uint_2 %uint_2 %uint_264
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %1
+ %10 = OpLabel
+ %11 = OpFunctionCall %void %workgroupBarrier_a17f7f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl
new file mode 100644
index 0000000..055d079
--- /dev/null
+++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl
@@ -0,0 +1,8 @@
+fn workgroupBarrier_a17f7f() {
+ workgroupBarrier();
+}
+
+[[stage(compute)]]
+fn compute_main() {
+ workgroupBarrier_a17f7f();
+}
diff --git a/test/intrinsics/intrinsics.wgsl.tmpl b/test/intrinsics/intrinsics.wgsl.tmpl
new file mode 100644
index 0000000..c23515f
--- /dev/null
+++ b/test/intrinsics/intrinsics.wgsl.tmpl
@@ -0,0 +1,179 @@
+{{- /*
+--------------------------------------------------------------------------------
+Template file for use with tools/intrinsic-gen to generate the wgsl files in the
+./gen/... subdirectories
+
+See:
+* tools/cmd/intrinsic-gen/gen for structures used by this template
+* https://golang.org/pkg/text/template/ for documentation on the template syntax
+--------------------------------------------------------------------------------
+*/ -}}
+
+{{- /* For each permutation of each overload of each function... */ -}}
+{{- range .Sem.Functions -}}
+{{- range .Overloads -}}
+{{- range Permute . -}}
+{{- /* Generate a ./gen/<function>/<permuataion-hash>.wgsl file using
+ the Permutation macro defined below */ -}}
+{{- $file := printf "./gen/%v/%v.wgsl" .Function.Name .Hash -}}
+{{- $content := Eval "Permutation" . -}}
+{{- WriteFile $file $content -}}
+{{- end }}
+{{- end }}
+{{- end }}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "Permutation" -}}
+{{- /* Emits the body of the intrinsic permuation .wgsl file */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- $function := .Function.Name -}}
+{{- $permutation := printf "%v_%v" $function .Hash -}}
+{{- $args := Map -}}
+
+{{- /* Generate a storage buffer for runtime sized array parameters */ -}}
+{{- if (Eval "HasStorageBufferArgs" .) -}}
+[[block]]
+struct SB {
+{{- range $i, $p := .Parameters }}
+{{- $class := Eval "StorageClass" $p.Type -}}
+{{- if eq "STORAGE_BUFFER" $class }}
+ arg_{{$i}}: {{template "Type" $p.Type}};
+{{ $args.Put $i (printf "sb.arg_%v" $i) -}}
+{{- end -}}
+{{- end -}}
+};
+[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
+{{ end -}}
+
+{{- /* Generate module-scoped resource variables (textures, samplers, etc) */ -}}
+{{- range $i, $p := .Parameters }}
+{{- $class := Eval "StorageClass" $p.Type -}}
+{{- if eq "RESOURCE" $class -}}
+ [[group(1), binding({{$i}})]] var arg_{{$i}}: {{template "Type" $p.Type}};
+{{ $args.Put $i (printf "arg_%v" $i) -}}
+{{- end -}}
+{{- end -}}
+
+{{- /* Generate the function that calls the intrinsic */ -}}
+fn {{$permutation}}() {
+{{/* Build the parameters either as 'var' or inline values */ -}}
+{{- range $i, $p := .Parameters -}}
+{{- $class := Eval "StorageClass" $p.Type -}}
+{{- if eq "PRIVATE" $class -}}
+{{- if eq "ptr" $p.Type.Target.Name -}}
+{{- /*indent*/}} var arg_{{$i}}: {{template "Type" index $p.Type.TemplateArguments 1}};
+{{ $args.Put $i (printf "&arg_%v" $i) -}}
+{{- else -}}
+{{- $args.Put $i (Eval "ValueOf" $p.Type) -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{- /* Make the call to the intrinsic */ -}}
+{{- /*indent*/}} {{/*indent*/ -}}
+{{- if .ReturnType -}}
+ var res: {{template "Type" .ReturnType}} = {{/* preserve space after = */ -}}
+{{- end -}}
+ {{$function}}(
+{{- range $i, $p := .Parameters -}}
+{{- if $i -}}, {{end}}{{$args.Get $i -}}
+{{- end -}}
+ );
+}
+{{/*new line*/ -}}
+
+{{- if .CanBeUsedInStage.Vertex }}
+[[stage(vertex)]]
+fn vertex_main() {
+ {{$permutation}}();
+}
+{{ end -}}
+
+{{- if .CanBeUsedInStage.Fragment }}
+[[stage(fragment)]]
+fn fragment_main() {
+ {{$permutation}}();
+}
+{{ end -}}
+
+{{- if .CanBeUsedInStage.Compute }}
+[[stage(compute)]]
+fn compute_main() {
+ {{$permutation}}();
+}
+{{ end -}}
+
+{{- end -}}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "HasStorageBufferArgs" -}}
+{{- /* Returns a non-empty string if the given overload has parameters */ -}}
+{{- /* that are in the STORAGE_BUFFER storage class */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- range $i, $p := .Parameters }}
+{{- $class := Eval "StorageClass" $p.Type -}}
+{{- if eq "STORAGE_BUFFER" $class -}}1
+{{ end -}}
+{{- end -}}
+{{- end -}}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "StorageClass" -}}
+{{- /* Returns the storage classs STORAGE_BUFFER, RESOURCE, or PRIVATE */ -}}
+{{- /* for the given Fully Qualified Name */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- $name := .Target.Name -}}
+{{- if eq $name "array" -}}STORAGE_BUFFER
+{{- else if HasPrefix $name "texture" -}}RESOURCE
+{{- else if HasPrefix $name "sampler" -}}RESOURCE
+{{- else -}}PRIVATE
+{{- end -}}
+{{- end -}}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "ValueOf" -}}
+{{- /* Returns a value of the given Fully Qualified Name argument */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- if eq .Target.Name "i32" -}}1
+{{- else if eq .Target.Name "u32" -}}1u
+{{- else if eq .Target.Name "f32" -}}1.0
+{{- else -}}{{template "Type" .}}()
+{{- end -}}
+{{- end -}}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "Type" -}}
+{{- /* Emits the WGSL for the Fully Qualified Name argument */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- if IsType .Target -}}
+{{- if eq .Target.Name "vec" -}}vec{{index .TemplateArguments 0}}<{{template "Type" index .TemplateArguments 1}}>
+{{- else if eq .Target.Name "mat" -}}mat{{index .TemplateArguments 0}}x{{index .TemplateArguments 1}}<{{template "Type" index .TemplateArguments 2}}>
+{{- else -}}{{.Target.Name}}{{template "TemplateArguments" .TemplateArguments}}
+{{- end -}}
+{{- else if IsEnumEntry .Target -}}{{.Target.Name}}
+{{- else if IsEnumMatcher .Target -}}{{(index .Target.Options 0).Name}}
+{{- else -}}<unhandled-fully-qualified-name-target={{- printf "%T" .Target -}}>
+{{- end -}}
+{{- end -}}
+
+
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- define "TemplateArguments" -}}
+{{- /* Emits the WGSL for the template argument list */ -}}
+{{- /* ------------------------------------------------------------------ */ -}}
+{{- if . -}}
+<
+{{- range $i, $a := . -}}
+{{- if $i -}}, {{ end -}}
+{{- if IsInt $a -}}{{- . -}}
+{{- else -}}{{- template "Type" $a -}}
+{{- end -}}
+{{- end -}}
+>
+{{- end -}}
+{{- end -}}
diff --git a/tools/src/cmd/intrinsic-gen/gen/generate.go b/tools/src/cmd/intrinsic-gen/gen/generate.go
index 6dad43b..8eb2666 100644
--- a/tools/src/cmd/intrinsic-gen/gen/generate.go
+++ b/tools/src/cmd/intrinsic-gen/gen/generate.go
@@ -30,6 +30,7 @@
t *template.Template
cached struct {
intrinsicTable *IntrinsicTable // lazily built by intrinsicTable()
+ permuter *Permuter // lazily built by permute()
}
}
@@ -68,6 +69,7 @@
"IsFirstIn": isFirstIn,
"IsLastIn": isLastIn,
"IntrinsicTable": g.intrinsicTable,
+ "Permute": g.permute,
"Eval": g.eval,
"WriteFile": func(relpath, content string) (string, error) { return "", writeFile(relpath, content) },
}).Option("missingkey=error").
@@ -108,6 +110,19 @@
return g.cached.intrinsicTable, nil
}
+// permute lazily calls buildPermuter(), caching the result for repeated
+// calls, then passes the argument to Permutator.Permute()
+func (g *generator) permute(overload *sem.Overload) ([]Permutation, error) {
+ if g.cached.permuter == nil {
+ var err error
+ g.cached.permuter, err = buildPermuter(g.s)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return g.cached.permuter.Permute(overload)
+}
+
// Map is a simple generic key-value map, which can be used in the template
type Map map[interface{}]interface{}
diff --git a/tools/src/cmd/intrinsic-gen/gen/permutate.go b/tools/src/cmd/intrinsic-gen/gen/permutate.go
new file mode 100644
index 0000000..8d84ad5
--- /dev/null
+++ b/tools/src/cmd/intrinsic-gen/gen/permutate.go
@@ -0,0 +1,349 @@
+// Copyright 2021 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.
+
+package gen
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "fmt"
+ "strings"
+
+ "dawn.googlesource.com/tint/tools/src/cmd/intrinsic-gen/sem"
+ "dawn.googlesource.com/tint/tools/src/fileutils"
+)
+
+// Permuter generates permutations of intrinsic overloads
+type Permuter struct {
+ sem *sem.Sem
+ allTypes []sem.FullyQualifiedName
+}
+
+// buildPermuter returns a new initialized Permuter
+func buildPermuter(s *sem.Sem) (*Permuter, error) {
+ // allTypes are the list of FQNs that are used for open, unconstrained types
+ allTypes := []sem.FullyQualifiedName{}
+ for _, ty := range s.Types {
+ if len(ty.TemplateParams) > 0 {
+ // Ignore aggregate types for now.
+ // TODO(bclayton): Support a limited set of aggregate types
+ continue
+ }
+ allTypes = append(allTypes, sem.FullyQualifiedName{Target: ty})
+ }
+ return &Permuter{
+ sem: s,
+ allTypes: allTypes,
+ }, nil
+}
+
+// Permutation describes a single permutation of an overload
+type Permutation struct {
+ sem.Overload // The permutated overload signature
+ Desc string // Description of the overload
+ Hash string // Hash of the overload
+}
+
+// Permute generates a set of permutations for the given intrinsic overload
+func (p *Permuter) Permute(overload *sem.Overload) ([]Permutation, error) {
+ state := permutationState{
+ Permuter: p,
+ closedTypes: map[sem.TemplateParam]sem.FullyQualifiedName{},
+ closedNumbers: map[sem.TemplateParam]interface{}{},
+ parameters: map[int]sem.FullyQualifiedName{},
+ }
+
+ out := []Permutation{}
+
+ // Map of hash to permutation description. Used to detect collisions.
+ hashes := map[string]string{}
+
+ // permutate appends a permutation to out.
+ // permutate may be chained to generate N-dimensional permutations.
+ permutate := func() error {
+ o := sem.Overload{
+ Decl: overload.Decl,
+ Function: overload.Function,
+ CanBeUsedInStage: overload.CanBeUsedInStage,
+ }
+ for i, p := range overload.Parameters {
+ ty := state.parameters[i]
+ if !validate(ty) {
+ return nil
+ }
+ o.Parameters = append(o.Parameters, sem.Parameter{
+ Name: p.Name,
+ Type: ty,
+ })
+ }
+ if overload.ReturnType != nil {
+ retTys, err := state.permutateFQN(*overload.ReturnType)
+ if err != nil {
+ return fmt.Errorf("while permutating return type: %w", err)
+ }
+ if len(retTys) != 1 {
+ return fmt.Errorf("result type not pinned")
+ }
+ o.ReturnType = &retTys[0]
+ }
+ desc := fmt.Sprint(o)
+ hash := sha256.Sum256([]byte(desc))
+ const hashLength = 6
+ shortHash := hex.EncodeToString(hash[:])[:hashLength]
+ out = append(out, Permutation{
+ Overload: o,
+ Desc: desc,
+ Hash: shortHash,
+ })
+
+ // Check for hash collisions
+ if existing, collision := hashes[shortHash]; collision {
+ return fmt.Errorf("hash '%v' collision between %v and %v\nIncrease hashLength in %v",
+ shortHash, existing, desc, fileutils.GoSourcePath())
+ }
+ hashes[shortHash] = desc
+ return nil
+ }
+ for i, param := range overload.Parameters {
+ i, param := i, param // Capture iterator values for anonymous function
+ next := permutate // Permutation chaining
+ permutate = func() error {
+ permutations, err := state.permutateFQN(param.Type)
+ if err != nil {
+ return fmt.Errorf("while processing parameter %v: %w", i, err)
+ }
+ if len(permutations) == 0 {
+ return fmt.Errorf("parameter %v has no permutations", i)
+ }
+ for _, fqn := range permutations {
+ state.parameters[i] = fqn
+ if err := next(); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+ }
+ for _, t := range overload.TemplateParams {
+ next := permutate // Permutation chaining
+ switch t := t.(type) {
+ case *sem.TemplateTypeParam:
+ types := p.allTypes
+ if t.Type != nil {
+ var err error
+ types, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Type})
+ if err != nil {
+ return nil, fmt.Errorf("while permutating open types: %w", err)
+ }
+ }
+ if len(types) == 0 {
+ return nil, fmt.Errorf("open type %v has no permutations", t.Name)
+ }
+ permutate = func() error {
+ for _, ty := range types {
+ state.closedTypes[t] = ty
+ if err := next(); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+ case *sem.TemplateEnumParam:
+ var permutations []sem.FullyQualifiedName
+ var err error
+ if t.Matcher != nil {
+ permutations, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Matcher})
+ } else {
+ permutations, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Enum})
+ }
+ if err != nil {
+ return nil, fmt.Errorf("while permutating open numbers: %w", err)
+ }
+ if len(permutations) == 0 {
+ return nil, fmt.Errorf("open type %v has no permutations", t.Name)
+ }
+ permutate = func() error {
+ for _, n := range permutations {
+ state.closedNumbers[t] = n
+ if err := next(); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+ case *sem.TemplateNumberParam:
+ // Currently all open numbers are used for vector / matrices
+ permutations := []int{2, 3, 4}
+ permutate = func() error {
+ for _, n := range permutations {
+ state.closedNumbers[t] = n
+ if err := next(); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+ }
+ }
+
+ if err := permutate(); err != nil {
+ return nil, fmt.Errorf("%v %v %w\nState: %v", overload.Decl.Source, overload.Decl, err, state)
+ }
+
+ return out, nil
+}
+
+type permutationState struct {
+ *Permuter
+ closedTypes map[sem.TemplateParam]sem.FullyQualifiedName
+ closedNumbers map[sem.TemplateParam]interface{}
+ parameters map[int]sem.FullyQualifiedName
+}
+
+func (s permutationState) String() string {
+ sb := &strings.Builder{}
+ sb.WriteString("Closed types:\n")
+ for ct, ty := range s.closedTypes {
+ fmt.Fprintf(sb, " %v: %v\n", ct.GetName(), ty)
+ }
+ sb.WriteString("Closed numbers:\n")
+ for cn, v := range s.closedNumbers {
+ fmt.Fprintf(sb, " %v: %v\n", cn.GetName(), v)
+ }
+ return sb.String()
+}
+
+func (s *permutationState) permutateFQN(in sem.FullyQualifiedName) ([]sem.FullyQualifiedName, error) {
+ args := append([]interface{}{}, in.TemplateArguments...)
+ out := []sem.FullyQualifiedName{}
+
+ // permutate appends a permutation to out.
+ // permutate may be chained to generate N-dimensional permutations.
+ var permutate func() error
+
+ switch target := in.Target.(type) {
+ case *sem.Type:
+ permutate = func() error {
+ out = append(out, sem.FullyQualifiedName{Target: in.Target, TemplateArguments: args})
+ args = append([]interface{}{}, in.TemplateArguments...)
+ return nil
+ }
+ case sem.TemplateParam:
+ if ty, ok := s.closedTypes[target]; ok {
+ permutate = func() error {
+ out = append(out, ty)
+ return nil
+ }
+ } else {
+ return nil, fmt.Errorf("'%v' was not found in closedTypes", target.GetName())
+ }
+ case *sem.TypeMatcher:
+ permutate = func() error {
+ for _, ty := range target.Types {
+ out = append(out, sem.FullyQualifiedName{Target: ty})
+ }
+ return nil
+ }
+ case *sem.EnumMatcher:
+ permutate = func() error {
+ for _, o := range target.Options {
+ if !o.IsInternal {
+ out = append(out, sem.FullyQualifiedName{Target: o})
+ }
+ }
+ return nil
+ }
+ case *sem.Enum:
+ permutate = func() error {
+ for _, e := range target.Entries {
+ if !e.IsInternal {
+ out = append(out, sem.FullyQualifiedName{Target: e})
+ }
+ }
+ return nil
+ }
+ default:
+ return nil, fmt.Errorf("unhandled target type: %T", in.Target)
+ }
+
+ for i, arg := range in.TemplateArguments {
+ i := i // Capture iterator value for anonymous functions
+ next := permutate // Permutation chaining
+ switch arg := arg.(type) {
+ case sem.FullyQualifiedName:
+ switch target := arg.Target.(type) {
+ case sem.TemplateParam:
+ if ty, ok := s.closedTypes[target]; ok {
+ args[i] = ty
+ } else if num, ok := s.closedNumbers[target]; ok {
+ args[i] = num
+ } else {
+ return nil, fmt.Errorf("'%v' was not found in closedTypes or closedNumbers", target.GetName())
+ }
+ default:
+ perms, err := s.permutateFQN(arg)
+ if err != nil {
+ return nil, fmt.Errorf("while processing template argument %v: %v", i, err)
+ }
+ if len(perms) == 0 {
+ return nil, fmt.Errorf("template argument %v has no permutations", i)
+ }
+ permutate = func() error {
+ for _, f := range perms {
+ args[i] = f
+ if err := next(); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+ }
+ default:
+ return nil, fmt.Errorf("permutateFQN() unhandled template argument type: %T", arg)
+ }
+ }
+
+ if err := permutate(); err != nil {
+ return nil, fmt.Errorf("while processing fully qualified name '%v': %w", in.Target.GetName(), err)
+ }
+
+ return out, nil
+}
+
+func validate(fqn sem.FullyQualifiedName) bool {
+ switch fqn.Target.GetName() {
+ case "array":
+ elTy := fqn.TemplateArguments[0].(sem.FullyQualifiedName)
+ elTyName := elTy.Target.GetName()
+ switch {
+ case elTyName == "bool" ||
+ strings.Contains(elTyName, "sampler"),
+ strings.Contains(elTyName, "texture"):
+ return false // Not storable
+ }
+ case "ptr":
+ storage := fqn.TemplateArguments[0].(sem.FullyQualifiedName).Target.(*sem.EnumEntry)
+ return storage.Name == "function"
+ }
+
+ for _, arg := range fqn.TemplateArguments {
+ if argFQN, ok := arg.(sem.FullyQualifiedName); ok {
+ if !validate(argFQN) {
+ return false
+ }
+ }
+ }
+
+ return true
+}
diff --git a/tools/src/cmd/intrinsic-gen/main.go b/tools/src/cmd/intrinsic-gen/main.go
index b6577ee..8be2966 100644
--- a/tools/src/cmd/intrinsic-gen/main.go
+++ b/tools/src/cmd/intrinsic-gen/main.go
@@ -82,7 +82,8 @@
// Recursively find all the template files in the <tint>/src directory
files, err := glob.Scan(projectRoot, glob.MustParseConfig(`{
"paths": [{"include": [
- "src/**.tmpl"
+ "src/**.tmpl",
+ "test/**.tmpl"
]}]
}`))
if err != nil {