[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/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();
+}